Skip to content

Instantly share code, notes, and snippets.

@SuperJMN
Last active August 29, 2015 14:08
Show Gist options
  • Save SuperJMN/b98f9971da9f953ded44 to your computer and use it in GitHub Desktop.
Save SuperJMN/b98f9971da9f953ded44 to your computer and use it in GitHub Desktop.
MenuOption1
public class Course : ValueObject<Course>
{
private readonly string name;
private readonly int defaultPriority;
public Course(string name, int defaultPriority)
{
this.name = name;
this.defaultPriority = defaultPriority;
}
public int DefaultPriority
{
get { return defaultPriority; }
}
public string Name
{
get { return name; }
}
}
public class Menu : Entity<Guid>
{
private readonly ICollection<MenuProduct> products = new Collection<MenuProduct>();
public void AddProduct(MenuProduct menuProduct)
{
products.Add(menuProduct);
}
public void RemoveProduct(MenuProduct menuProduct)
{
products.Remove(menuProduct);
}
public IEnumerable<MenuProduct> Products
{
get { return products; }
}
}
public class MenuProduct : Entity<Guid>
{
public MenuProduct(string name) : base(Guid.NewGuid())
{
this.Name = name;
}
public string Name { get; set; }
public Course Course { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment