Is it possible to map an ActiveRecord class using the MetadataType attribute in order to keep the original class clean?
I have tried the following code but it didn't work:
[MetadataType(typeof(UserMetadata))]
public class User : ActiveRecordBase<User>
{
public int Id { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
}
[ActiveRecord("Users")]
public class UserMetadata
{
[PrimaryKey("ID")]
public int Id { get; set; }
[Property(Unique = true)]
public string UserName { get; set; }
[Property]
public string Password { get; set; }
}
ActiveRecord is simply not loading the mapping. I have also tried other combinations of attributes but none of them worked.
Is it possible?
Not really a definitive solution, but I ended up using a partial class to clean my code.