public class Rental
{
public int Id { get; set; }
public int CustomerId { get; set; }
public Customer Customer { get; set; }
public ICollection<Equipment> Equipment { get; } = new List<Equipment>();
public DateTime RentalDate { get; set; }
public DateTime ReturnDate { get; set; }
[JsonIgnore]
public float TotalCost => Equipment.Sum(p => p.Cost);
}
public class Rental
{
public int Id { get; set; }
public int CustomerId { get; set; }
public Customer Customer { get; set; }
public ICollection<Equipment> Equipment { get; } = new List<Equipment>();
public DateTime RentalDate { get; set; }
public DateTime ReturnDate { get; set; }
[JsonIgnore]
public float TotalCost => Equipment.Sum(p => p.Cost);
}