July 2019
Intermediate to advanced
410 pages
10h 32m
English
With our repository available, the three InventoryCommand classes can be completed. The first, AddInventoryCommand, is shown as follows:
internal class AddInventoryCommand : NonTerminatingCommand, IParameterisedCommand{ private readonly IInventoryContext _context; internal AddInventoryCommand(IUserInterface userInterface, IInventoryContext context) : base(userInterface) { _context = context; } public string InventoryName { get; private set; } /// <summary> /// AddInventoryCommand requires name /// </summary> /// <returns></returns> public bool GetParameters() { if (string.IsNullOrWhiteSpace(InventoryName)) InventoryName = GetParameter("name"); return !string.IsNullOrWhiteSpace(InventoryName); } protected override bool ...Read now
Unlock full access