Last active
October 31, 2017 12:53
-
-
Save rmaziarka/8447756fbb0084a273fe19cd83e22189 to your computer and use it in GitHub Desktop.
CQRS - Second step - Simple read model - Product view model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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