Im using the EF Power Tools to Reverse Engineer an existing Database. This is fine. Under the EDMX Database-1st Route I would create partial classes for any overrides like Data Annotations, for e.g. here, LedgerPeriod being the original EntityObject:
[MetadataType(typeof(LedgerPeriodMetaData))]
public partial class LedgerPeriod
{
public class LedgerPeriodMetaData
{
[Required(ErrorMessage = "Period Start Date Required")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
[DataType(DataType.Date)]
public object PeriodDateFrom { get; set; }
[Required(ErrorMessage = "Period End Date Required")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
[DataType(DataType.Date)]
public object PeriodDateTo { get; set; }
}
}
This is fine. Now do I use the same approach for Code First Reverse Engineer or are there any custom settings whereby if you have to run the power tools multiple times, because say I added a new Table to the Database, it wouldn't overwrite any changes to the existing Models created previously.
This would ultimately mean I can make changes to the actual model classes themselves, instead of creating partial classes.
Reference to the EF Powertools can be found here:
http://blogs.msdn.com/b/adonet/archive/2012/04/09/ef-power-tools-beta-2-available.aspx