I have below class and I want to know is there any way to calculate TotalBalance field Automatically with Entityframework?
public class Class_Dept_Cred_Balance_Customer
{
public long LngCustomerID { get; set; }
public Double TotalDebt { get; set; }
public Double TotalCred { get; set; }
public Double TotalBalance { get; set; }
}
It is better to ask this: Is there a way for me to explain to the framework within the above class that field TotalBalance is a computational field and that the program automatically calculates the result wherever this class is used?
TotalBalance = (TotalDebt - TotalCred)