I am getting an error while fetching data from db.The error is like this:-
{"Invalid column name 'Amount_Value'.\r\nInvalid column name 'Amount_Currency'.\r\nInvalid column name 'Amount_Value'.\r\nInvalid column name 'Amount_Currency'."}
Here is my main model of "Deals":-
public class Deal {
public long ID { get; set; }
[StringLength(1024),Required]
public string Title { get; set; }
public Client Party { get; set; }
public long PartyID { get; set; }
public DateTime Created { get; set; }
public long Version { get; set; }
[DataType(DataType.MultilineText)]
public string Notes { get; set; }
public Money Amount { get; set; }
public DealKindEnum Mode { get; set; }
}
Here "Money" is another class which is like this:-
public class Money
{
[DataType(DataType.Currency)]
public double Value { get; set; }
public string Currency { get; set; }
}
I am getting error while using this query:--
var query = from client in db.Clients
join ra in db.Deals on client.ID equals ra.PartyID
where (ra.ID == id || id == 0)
select ra;
public virtual Money Amount {get;set;}If it's not, you should mark withNotMappedAttribute([NotMapped]on property)