internal Shoe Edit(Shoe updatedShoe) { Shoe original = Get(updatedShoe.Id); original.Name = updatedShoe.Name; original.Price = updatedShoe.Price != 0 ? updatedShoe.Price : original.Price; original.Size = updatedShoe.Size != 0 ? updatedShoe.Size : original.Size; original.MfgId = updatedShoe.MfgId != 0 ? updatedShoe.MfgId : original.MfgId; _repo.Edit(original); return(original); }
public Shoe Edit(Shoe newData) { Shoe shoe = _repo.Get(newData.Id); if (shoe == null) { throw new Exception("Invalid Id Homie"); } shoe.Color = newData.Color; shoe.Name = newData.Name; shoe.Price = newData.Price; shoe.Size = newData.Size; _repo.Edit(shoe); return(shoe); }