0

I have Field named Title.

Then How to set MinLength is 10 and MaxLength 50 using fluent api?

Naresh
  • 15
  • 6
  • Does this answer your question? [Does the EF Fluent Api can setting the Minimum Length?](https://stackoverflow.com/questions/34533233/does-the-ef-fluent-api-can-setting-the-minimum-length) – itminus Feb 24 '20 at 07:26

1 Answers1

0

You can't validate with fluent api. It's just for database modeling. You need to use Data Annotations or Fluent Validation. I recommend you to use Fluent Validation with Form Helper to validate your models.

Sinan Bozkuş
  • 317
  • 4
  • 9