I ran into an interesting problem when I tried to use Entity Framework Core with the new nullable reference types in C# 8.0....The Entity Framework (various flavors) allows me to declare DBSet properties that I never initalize. For example:... public ...
Using C# 8 e ASP.NET Core I have the following:... Context context = new Context();
Post post1 = new Post {
Enabled = true,
Title = "Some title"
};
Post post2 = post1;
post2.Enabled = false;
context.Posts.Add(post1);
context.Posts....
I'm writing ASP.NET Core 3.1 Web API and I caught myself being confused... if I use the right type to return. ...So here is my code (I removed paging for simplicity):...public class UserData
{
public IEnumerable<UserDto> GetUsers()
{
var u...
I'm trying to embrace C# 8's nullable references types in my project and make it smoothly work with EF Core....Following ...this guide..., I made my entity classes have constructors accepting all data needed for initializing their non-nullable properties:...