public DisposeList GetUserDisposeList(string username) { ServiceValidator.ValidateString(username, nameof(username)); var models = _dac.SelectDisposeList(username); return(new DisposeList { Items = models .Select(i => new DisposeList.DisposeListItem { BarCode = i.barcode, Count = i.count, DisposeListToItemId = i.objid, Name = i.name, }) .ToList() }); }
public ShoppingList GetUserShoppingList(string username) { ServiceValidator.ValidateString(username, nameof(username)); var models = _dac.SelectShoppingList(username); return(new ShoppingList { Items = models .Select(i => new ShoppingList.ShoppingListItem { BarCode = i.barcode, Count = i.count, Name = i.name, ShoppingListToItemId = i.objid }) .ToList() }); }
public void AddItem(string barcode, string username) { ServiceValidator.ValidateString(username, nameof(username)); _dac.AddItem(barcode, username); }