Last post Sep 12, 2019 07:20 AM by Mikesdotnetting
Sep 02, 2019 02:28 PM|vinodkpasi|LINK
What is the difference between MaxLength and StringLength attribute in Entity Framework?
Sep 02, 2019 02:41 PM|Mikesdotnetting|LINK
They can both be used to configure the size of the storage for a string value in a database, but MaxLength also enforced entity validation in EF 4.1 onwards. Entity validation was not included in EF Core.
Sep 12, 2019 04:51 AM|vinodkpasi|LINK
I am using Code-First approach. StringLength and MaxLength both are enforcing entity validation. Can you elaborate more on differences?
Sep 12, 2019 07:20 AM|Mikesdotnetting|LINK
MaxLength only enables you to specify a maximum length. StringLength enables you to specify a minimum and maximum length.