I have class from model first (EF 4.4 .Net 4.0):
public partial class Test
{
public int Id {get; set; }
public int Date { get; set; }
//other fields...
}
I can't change database model but I need to override get and set in this class. Something like that:
[MetadataType(typeof(TestMetadata))]
public partial class Test
{
public class TestMetadata
{
private int data;
public DateTime Date
{
get
{
return DateTime.Today.Date;
}
set
{
date = value.Day;
}
}
}
This approach dosen't work. Is it any possibilities to override get set in partial calss?