Skip to content

Instantly share code, notes, and snippets.

@rmaziarka
Last active October 31, 2017 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmaziarka/8447756fbb0084a273fe19cd83e22189 to your computer and use it in GitHub Desktop.
Save rmaziarka/8447756fbb0084a273fe19cd83e22189 to your computer and use it in GitHub Desktop.
CQRS - Second step - Simple read model - Product view model
public class ProductVm
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
public string CategoryName { get; set; }
public string PictureUrl { get; set; }
public string ManufacturerName { get; set; }
public string ManufacturerMainPictureUrl { get; set; }
public List<RelatedProductVm> RelatedProducts { get; set; } = new List<RelatedProductVm>();
public int OrdersNumber { get; set; }
public List<FieldValueVm> FieldValues { get; set; } = new List<FieldValueVm>();
public float AverageReviewRating { get; set; }
public List<ReviewVm> LatestReviews { get; set; } = new List<ReviewVm>();
public List<DiscountVm> BestDiscounts { get; set; } = new List<DiscountVm>();
}
public class RelatedProductVm
{
public int Id { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public string PictureUrl { get; set; }
public int MainProductId { get; set; }
}
public class FieldValueVm
{
public string FieldName { get; set; }
public string FieldType { get; set; }
public string StringValue { get; set; }
public int IntegerValue { get; set; }
public int ProductId { get; set; }
}
public class ReviewVm
{
public string UserName { get; set; }
public DateTime CreateDate { get; set; }
public float Rating { get; set; }
public int ProductId { get; set; }
}
public class DiscountVm
{
public float Value { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public int MainProductId { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment