Skip to content

Instantly share code, notes, and snippets.

@aramkoukia
Created January 20, 2018 22:36
Show Gist options
  • Save aramkoukia/4aa5e698e73b6645420f76d4b0deb56c to your computer and use it in GitHub Desktop.
Save aramkoukia/4aa5e698e73b6645420f76d4b0deb56c to your computer and use it in GitHub Desktop.
Product Commands
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