Convert from HttpResponseMessage to IActionResult in .NET Core

You can return using hardset status codes like Ok(); or BadRequest(); Or return using a dynamic one using StatusCode(<Your status code number>,<Optional return object>); This is using Microsoft.AspNetCore.Mvc Below is this.StatusCode spelled out a little more: /* “this” comes from your class being a subclass of Microsoft.AspNetCore.Mvc.ControllerBase */ StatusCodeResult scr = this.StatusCode(200); /* OR */ … Read more

Differences between ASP.NET Web Application (.NET Framework) vs ASP.NET Core Web Application (.NET Framework)

Option 1 – ASP.NET Web Application Option 3 – ASP.NET Core Web Application Although both project templates use Full .Net Framework, Option 1 is for creating projects using legacy version of ASP.NET MVC in which we can use Global.asax. Option 3 is totally new concept in which wwwroot folder, using task runners and everything is … Read more

What does the [Intrinsic] attribute in C# do?

Here’s what I’ve managed to find after a very limited search through dotnet/corefx repository on github. [Intrinsic] marks methods, properties and fields that can be potentially replaced/optimized by JIT. Source code comments say something similar (IntrinsicAttribute.cs): Calls to methods or references to fields marked with this attribute may be replaced at some call sites with … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)