Databases Reference
In-Depth Information
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class EntityUIHintAttribute : Attribute
{
public EntityUIHintAttribute(string entityUIHint)
{
this.EntityUIHint = entityUIHint;
}
public string EntityUIHint { get; private set; }
}
}
This attribute is applied to an entity class or its associated metadata class. Its constructor
takes a string that serves as the entity UI hint and stores it in the EntityUIHint property,
which is accessed by the page templates. Here is how definition of the Employee entity
class looks with the new hint applied:
[MetadataType(typeof(Metadata))]
partial class Employee
{
[EntityUIHint(“TwoColumn”)]
private abstract class Metadata
{
[Display(GroupName = “Left”, Order = 100)]
public object FirstName { get; set; }
[Display(GroupName = “Left”, Order = 110)]
public object LastName { get; set; }
[Display(GroupName = “Right”, Order = 200)]
public object Address { get; set; }
[Display(GroupName = “Right”, Order = 210)]
public object City { get; set; }
}
}
Similar to the field template hint specified with the UIHintAttribute , the entity hint is a
name of a particular template you want Dynamic Data to use instead of the default. In
this example, TwoColumn is the name of the new dynamic entity template created shortly
to implement a simple two-column form layout.
 
Search WWH ::




Custom Search