Hi, I am using Entity Developer Version 6.5.823!
I have made a complex EF Core Model which I have to edit very often, it would be cool If I can create a custom types (string, int and so) with certain validation properties for example:
MyTypeEmail
Value: String
Validate Max Length: 128
Validate Format: Email
MyTypeUrl
Value: String
Validate Max Length: 255
In my model I have many entities which contain Emails (string type) the Idea is to map all this Email Properties with the MyTypeEmail so that If I need to change the Validate Max Length in the future I modify the properties of MyTypeEmail only and not each of the Email properties scattered throughout the model.
And also, next time I create a property that is an Email I map it to the corresponding MyTypeEmail.
Maybe this option already exists, but I have search in the Documentation and the forums and I can´t find any result.
Thanks in Advance!
Custom Types (Already Exists?)
Re: Custom Types (Already Exists?)
EntityComplexType in EF Core Model includes the Is External property.
Its description: "Indicates that the complex type is a reference to an external type. If the value is set to 'True', code generation is disabled for this complex type."
So, define a custom type in your code with all required attributes, create a complex type with the same name and Is External=True in EF Core Model, use it for setting the Type in your class properties.
Its description: "Indicates that the complex type is a reference to an external type. If the value is set to 'True', code generation is disabled for this complex type."
So, define a custom type in your code with all required attributes, create a complex type with the same name and Is External=True in EF Core Model, use it for setting the Type in your class properties.