Closed lukos closed 2 years ago
And also ColumnNameToDataAnnotation
seems to have been removed. We used it for adding DataType attributes. I can obviously put something back in manually but maybe this functionality was intended to be changed to use something else that I can't find?
Hi Luke,
At approx line 93 in your <database>.tt
file, set
Settings.UseDataAnnotations = true;
The ColumnNameToDataAnnotation
has been removed in v3 as it was not longer required. Data annotations are now handled in your <database>.tt
file which makes it customisable. See the Settings.UpdateColumn callback approx line 311.
Thanks @sjh37 it seems mostly OK although ColumnNameToDataAnnotation
was neater because we only had to set this in settings and it applied it automatically. The way it is done now, I have to manually created the dictionaries and also work out the code to apply the annotations if there is an entry, which is pretty much copied from the v2 template.
Having a very generic method is obviously powerful but it would be nice to include some of the common features that were in the older version to avoid re-inventing the wheel.
Upgrading from v2 to v3 and I've noticed that this setting is not there any more. We used to use it to add non EF attributes to columns (as per the v2 description), like MaxLength and Display.
How do we do this now while keeping the fluent generation?
Thanks