Hello everyone my problem is very simple. Using entity framework code first
I want to multiply two properties in different tables. The problem is that before I used an int type and now I have to use the time. How can I do?
As I tried to nettere a thing in the property Time
public class Employe
{
public Timespan Time { get; set; }
}
public class Customer
{
public double Cost { get; set; }
[NotMapped]
public double Total { get { return Cost * Employe.Time.TotalMinutes } }
}
What data type should I use to do this?
I have to multiply the cost over time because then I have to return a query with the total hours worked. The time represents the hours the employee
If your
Timeproperty is supposed to store how long an Employee has worked for, maybe you need theTimeSpantype instead ofDateTime. Then you could do something like