Breezy icon indicating copy to clipboard operation
Breezy copied to clipboard

Nullable type cause generate incorect code

Open NotAsea opened this issue 1 year ago • 0 comments

So i declare my Entity has nullable property like

[Table("Config")]
public class Config 
{
    public string Key { get; set; } = string.Empty;
    // --snifff----//
    public int? OrganizationId { get; set; } // <-- this nullable int cause trouble
}

and look at generated code i can see the problem

// a bunch of generated code before
var organizationId = (Nullable)reader.GetInt32(6); // <-- this strange Nullable cast

if i remove ? and make it nonnullable then it run fine

project: asp.net core 8 minimal api

NotAsea avatar May 11 '24 02:05 NotAsea