I’ve done this before with MVC5 using User.Identity.GetUserId() but that doesn’t seem to work here. The User.Identity doesn’t have the GetUserId() method. I am using Microsoft.AspNet.Identity. 20 Answers 20
  • May 21, 2022
  • 0 Comments
Back in RC1, I would do this: [HttpPost] public IActionResult Post([FromBody]string something) { try{ // ... } catch(Exception e) { return new HttpStatusCodeResult((int)HttpStatusCode.InternalServerError); } } In RC2, there no...
  • May 18, 2022
  • 0 Comments
In appsettings.json { "MyArray": [ "str1", "str2", "str3" ] } In Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddSingleton<IConfiguration>(Configuration); } In HomeController public class HomeController : Controller { private readonly...
  • May 17, 2022
  • 0 Comments