TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

Scaffold EF Core models using Handlebars templates.
MIT License
208 stars 53 forks source link

DateTime Required Annotation #207

Open geezz07 opened 2 years ago

geezz07 commented 2 years ago

Hi there,

In my database I have a column for a DateTime that is required however the "Required" data annotation is not appearing. Should the line in the code below be "!property.ClrType.IsNullableType()"?

https://github.com/TrackableEntities/EntityFrameworkCore.Scaffolding.Handlebars/blob/2b65b77607ba1212a3b2a7c559cacf3d250bfb59/src/EntityFrameworkCore.Scaffolding.Handlebars/HbsCSharpEntityTypeGenerator.cs#L630

Thanks

tonysneed commented 2 years ago

I'll see if I can reproduce.

If you like, could you create a Pull Request simple unit test?