Created
January 20, 2018 22:36
-
-
Save aramkoukia/4aa5e698e73b6645420f76d4b0deb56c to your computer and use it in GitHub Desktop.
Product Commands
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
using System; | |
using MicroServices.Common; | |
namespace Products.Service.MicroServices.Products.Commands | |
{ | |
public class CreateProduct : ICommand | |
{ | |
public Guid Id { get; private set; } | |
public string Name { get; private set; } | |
public string Description { get; private set; } | |
public decimal Price { get; set; } | |
public CreateProduct(Guid id, string name, string description, decimal price) | |
{ | |
Id = id; | |
Name = name; | |
Description = description; | |
Price = price; | |
} | |
} | |
public class AlterProduct : ICommand | |
{ | |
public Guid Id { get; private set; } | |
public string NewTitle { get; set; } | |
public string NewDescription { get; set; } | |
public decimal NewPrice { get; set; } | |
public int OriginalVersion { get; private set; } | |
public AlterProduct(Guid id, int originalVersion, string newTitle, string newDescription, decimal newPrice) | |
{ | |
Id = id; | |
NewTitle = newTitle; | |
NewDescription = newDescription; | |
NewPrice = newPrice; | |
OriginalVersion = originalVersion; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment