I have a fairly large data model that I want to expose using Web API OData using the OData V4 protocol.
The underlying data is stored in a SQL Server 2012 database.
public class Customer
{
private DateTimeWrapper dtw;
public int Id { get; set; }
public string Name { get; set; }
public DateTime Birthday
{
get { return dtw; }
set { dtw = value; }
}
[NotMapped]
public DateTimeOffset BirthdayOffset
{
get { return dtw; }
set { dtw = value; }
}
}
var customer = builder.EntityType();
customer.Ignore(t => t.Birthday);
customer.Property(t => t.BirthdayOffset).Name = "Birthday";