i am working on an asp.net mvc-4 web application . and i am using Entity Framework 5. where i mapped my database tables using EF.
now i use to have the following model class inside my .tt folder:-
public partial class CustomAsset
{
public string CustomerName { get; set; }
public int CustomTypeID { get; set; }
public string Description { get; set; }
public int ID { get; set; }
public int Quantity { get; set; }
public virtual CustomAssetType CustomAssetType { get; set; }
}
now inside my DB table named "customAsset" i remove the CustomerName
column. and i added two columns one of them is a foreign key to another table. then i open my .edmx file i right-click , then i chose to update model from database, where i select the realted table and click on update. now the model inside the .edmx file got the new columns/relation correctly as follow:-
but my related .tt class is still referencing the old columns. i was expecting my .tt model class to be as follow:-
public partial class CustomAsset
{
//public string CustomerName { get; set; }
public int CustomTypeID { get; set; }
public string Description { get; set; }
public int ID { get; set; }
public int Quantity { get; set; }
public int? CustomerID { get; set; }
public int? RackID { get; set; }
public virtual CustomAssetType CustomAssetType { get; set; }
public virtual Rack Rack { get; set; }
}
so not sure how i can force my .tt classes to get updated , when i update the .edmx file ? and is there any problem if i manually modify the related .tt classes to get the new columns/ relation ?