Така че вместо GetSequence
използвайте свойство:
public class InvoiceNumberSequence {
public string Prefix { get; set; }
public int Number { get; set; }
public string Sequence {
get { retrun Prefix + Number; }
set { // Add your parsing logic }
}
}
И в картографирането добавете:
modelBuilder.ComplexType<InvoiceNumberSequence>()
.Property(p => p.Sequence)
.HasColumnName("INVOICE_SEQ");
modelBuilder.ComplexType<InvoiceNumberSequence>()
.Ignore(p => p.Prefix);
modelBuilder.ComplexType<InvoiceNumberSequence>()
.Ignore(p => p.Number);