This question is locked. New answers and comments are not allowed.
Hi.
Does OpenAccess Free Edition support C# virtual properties?
The simple test example is not working. I have compile time error:
Error 23 There is no field with name 'name' backing 'Name' property in type 'Roof.ExtendedModel.Entities.TestDerived'. You need to either change the Field Naming rules of the mapping configuration object or call HasFieldName(string) with the name of the backing field.
Alexander.
Does OpenAccess Free Edition support C# virtual properties?
The simple test example is not working. I have compile time error:
Error 23 There is no field with name 'name' backing 'Name' property in type 'Roof.ExtendedModel.Entities.TestDerived'. You need to either change the Field Naming rules of the mapping configuration object or call HasFieldName(string) with the name of the backing field.
public class TestBase
{
public Int64 Id { get; set; }
public virtual string Name
{
get
{
return "";
}
set
{
}
}
public new static MappingConfiguration GetMapping()
{
MappingConfiguration<
TestBase
> m = new MappingConfiguration<
TestBase
>();
m.MapType();
m.HasProperty(p => p.Id).IsIdentity(KeyGenerator.Autoinc);
m.HasProperty(p => p.Name).AsTransient();
return m;
}
}
public class TestDerived : TestBase
{
public override string Name
{
get
{
return "";
}
set
{
}
}
public new static MappingConfiguration GetMapping()
{
MappingConfiguration<
TestDerived
> m = new MappingConfiguration<
TestDerived
>();
m.MapType().Inheritance(InheritanceStrategy.Vertical);
m.HasProperty(p => p.Name).AsTransient();
return m;
}
}
Alexander.