C#C
C#4y ago
barcode

What does null! do in EF CORE? [Answered]

Hi, I've used scaffold db to generate models from existing table and I noticed this interesting pattern

    public City City { get; set; } = null!;


Keep in mind city_id must not be null so why does EF Core generate it with default value of null and what does ! mean after unll?
Was this page helpful?