Open cremor opened 4 weeks ago
@cremor the point of this plugin is to provide support for standard .NET plugins which are already there - [StringLength] is part of .NET. If you just want to specify a minimum length check constraint in EF via the Fluent API, you can simply define the check constraint directly via EF's API (docs).
Yes, but with manually written check constraints I also have to manually do all the work that this library is already doing when I use attributes, like:
I like that this library does all that automatically 😄
I'll leave this open in the backlog, but all the above really is trivial stuff - this plugin really was meant for making the built-in .NET attributes work, not making a really simple task even a big simpler :)
It would be great if this library could also provide fluent mapping APIs to allow mapping of check constraints without using attributes.
Example: There is no
HasMinLength()
fluent mapping method. So you have to use a[StringLength(2, MinimumLength = 2)]
attribute to get a min length check constraints.