Run NUnit tests in .NET Core

Update 4: The NUnit3TestAdapter v3.8 has been released, so it is no longer alpha. Update 3: With NUnit3TestAdapter v3.8.0-alpha1 it is possible now to run the tests using dotnet test command. You just need to have these dependencies in your test project: <PackageReference Include=”nunit” Version=”3.7.0″ /> <PackageReference Include=”NUnit3TestAdapter” Version=”3.8.0-*” /> <PackageReference Include=”Microsoft.NET.Test.Sdk” Version=”15.*” /> You … Read more

EntityFramework code first: Set order of fields

Currently ordering columns by class property is not implemented. Here’s the long discussion about column ordering. Column ordering #2272 Update as of 07/12/2017 This issue is in the Backlog milestone. This means that it is not going to happen for the 2.0 release. We will re-assess the backlog following the 2.0 release and consider this … Read more

Change default format for DateTime parsing in ASP.NET Core

Had the same problem. While passing DateTime in request body works fine (because Json converter handles this staff), passing DateTime in query string as a parameter has some culture issues. I did not like the “change all requests culture” approach, bacause this could have impact on other type’s parsing, which is not desirable. So my … Read more

Is .NET Core Runtime backwards compatible with previous releases?

Edit .NET Core 3.x SDK has been released. Unlike v2.2 and the previous releases before it, this version does not support the ability to target previous runtimes (i.e. netcoreapp2.2, netcoreapp2.1, etc) tldr; Yes. By installing .NET Core Runtime 2.2.3, you can run apps which target netcoreapp2.0, netcoreapp2.1, and netcoreapp2.2, without requiring additional runtimes to be … Read more

ASP.NET Core – Create custom model validation

There are two ways to do custom model validation in ASP.NET Core: A custom attribute subclassed from ValidationAttribute. This is useful when you want to apply custom business logic to a particular model property with an attribute. Implementing IValidatableObject for class-level validation. Use this instead when you need to do validation on an entire model … Read more

HttpContext.Authentication.SignOutAsync does not delete auth cookie

You didn’t post enough code to tell, but I suspect after you call SignOutAsync you have some type of redirect (for example, RedirectToAction) which overwrites the redirect to the OIDC endsession URL that SignOutAsync tries to issue. (The same explanation for the redirect overwrite problem is given here by Microsoft’s HaoK.) Edit: If my speculation … Read more