I've got a class that is derived from a simple base class.
public class A
{
public string Id { get; set; }
public long Value { get; set; }
}
public class B: A {}
I build the mapping for B like this
...
builder.Entity<B>().Property(p => p.Id)....
builder.Entity<B>().Property(p => p.Value)....
...
I get the following error when I call DataContext.CreateDatabase(false, true)
"Table 'B' has no columns."
The same steps work if I replace 'B' with 'A' in the table definition and in the fluent-specific code.
Question: How can I map the public properties of a base class as columns?
Fluent mapping of base class columns
Re: Fluent mapping of base class columns
Sorry for the delay. Please refer to these articles:
https://www.devart.com/linqconnect/docs ... pping.html
https://www.devart.com/linqconnect/docs/?FluentTPT.html
https://www.devart.com/linqconnect/docs/?FluentTPH.html
If the provided information doesn't help to solve the issue, please create a small test project with which this error could be reproduced and send it us.
This will significantly speed up the process of determining the cause of the error and finding the solution for you.
Looking forward to your reply.
https://www.devart.com/linqconnect/docs ... pping.html
https://www.devart.com/linqconnect/docs/?FluentTPT.html
https://www.devart.com/linqconnect/docs/?FluentTPH.html
If the provided information doesn't help to solve the issue, please create a small test project with which this error could be reproduced and send it us.
This will significantly speed up the process of determining the cause of the error and finding the solution for you.
Looking forward to your reply.
Re: Fluent mapping of base class columns
Thanks for the links. I missed the inheritance part of the documentation. TPH should provide and adequate solution for my problem.
Re: Fluent mapping of base class columns
If you encounter any issues with this, feel free to contact us.