am using a computed property inside a ShoppingCart model, but the product property is getting a null reference and throw a null reference error, can you please inform me if am computing the TotalWeight property properly.
[Key]
public int Id { get; set; }
public int ProductId { get; set; }
public virtual Products Product { get; set; }
[Display(Name = "Quantity")]
public int Quantity { get; set; }
[NotMapped]
public int TotalWeight
{
get
{
return this.Quantity * this.Product.Weight;
}
}