I face a problem when I try to get value from primary table in my mapping file.
My tables:
CREATE TABLE Customer ( [CustomerId] INT PRIMARY KEY, [FullName] NVARCHAR(50) NOT NULL ) CREATE TABLE CustomerOrder ( [CustomerOrderId] INT PRIMARY KEY, [CustomerId] INT, [TransactionDate] DATETIME )
My classes:
public class CustomerOrder { public class Id {get; set;} public class CustomerName {get; set;} public class TransactionDate {get; set;} } ...
How can I get FullName value and map to CustomerName property in my CustomerOrder fluent interface mapping class?
You wouldn’t, really. A better design would be to have a Customer property, which is an instance of a Customer class.
Which you can then use like so:
If you really want to have a
CustomerNameproperty, you could create a delegating property onCustomerOrder.