I am trying to get some experience with v5, especially looking at the new feature for derived models. I created a simple derived model based on Northwind Order and added some addition denormalized fields for Customer.
I am having two issues. One seems like a bug and the other is a design question.
I was expecting that the code generation would add attributes to the fields for things like Required, StringLength, and perhaps DataType. However, it doesn't do that.
Here's what I get
/// <summary>Gets or sets the OrderDate field. Derived from Entity Model Field 'Order.OrderDate'</summary>
[DataMember]
public Nullable<System.DateTime> OrderDate { get; set; }
/// <summary>Gets or sets the Freight field. Derived from Entity Model Field 'Order.Freight'</summary>
[DataMember]
public Nullable<System.Decimal> Freight { get; set; }
/// <summary>Gets or sets the CustomerCompanyName field. Derived from Entity Model Field 'Customer.CompanyName (Customer)'</summary>
[DataMember]
public System.String CustomerCompanyName { get; set; }
Here's what I want.
/// <summary>Gets or sets the OrderDate field. Derived from Entity Model Field 'Order.OrderDate'</summary>
[DataMember]
[DataType(DataType.DateTime)]
public Nullable<System.DateTime> OrderDate { get; set; }
/// <summary>Gets or sets the Freight field. Derived from Entity Model Field 'Order.Freight'</summary>
[DataMember]
public Nullable<System.Decimal> Freight { get; set; }
/// <summary>Gets or sets the CustomerCompanyName field. Derived from Entity Model Field 'Customer.CompanyName (Customer)'</summary>
[DataMember]
[Required]
[StringLength(40)]
public System.String CustomerCompanyName { get; set; }
I added some attributes in the designer and generated the code. That works but it's a lot of work in the designer that I think the tool should do for me.
Also, when I close the project, it does not save the attributes that I put into the designer. I would hope that this is a bug.