I am creating a Blazor WebAssembly app, and I have two classes (shown below). In WorkDay I want to calculate how much I will pay in taxes by using PayRate from the Job class. How can I get this to work?
public class WorkDay
{
public double Hours { get; set; }
public double? Subtotal { get; set; }
public double TaxRate { get; set; } = 0.1;
public double Taxes
{
get { return ((Hours * 15.74) * TaxRate); }
}
public double? Final
{
get { return ((Hours * 15.74) - Taxes); }
}
}
And
public class Job
{
public Job(string organization, double payRate)
{
Organization = organization;
PayRate = payRate;
}
public string Organization { get; set; }
public double? PayRate { get; set; }
public List<int> PayDays { get; set; } = new List<int>();
public List<PayPeriod> PayPeriods { get; set; } = new List<PayPeriod>();
}
I think this is what you want: