Project DescriptionShows how to use PostSharp to allow the use of C# automatic properties with the Express Persistent Objects (XPO) ORM from Developer Express.
Typically in the
Express Persistent Objects (XPO) ORM from
Developer Express your code would look something like:
public class Customer: XPObject
{
private DateTime date;
public DateTime Date
{
get { return date; }
set { SetPropertyValue("Date", ref date, value); }
}
[Association("CustomerOrders", typeof(Order))]
public XPCollection<Order> Orders
{
get { return GetCollection<Order>("Orders"); }
}
}
This project uses
PostSharp to let you take advantage of C# automatic properties in XPO, leading to less code to write:
public class Customer: XPObject
{
public DateTime Date { get; set; }
[Association("CustomerOrders")]
public XPCollection<Order> Orders
{
get; private set;
}
}
Further Reading
RequirementsYou will need to
PostSharp version 1.0 and
XPO (I've used version 8.2 trial).