public Brick Edit(Brick editBrick) { Brick original = Get(editBrick.Id); original.Name = editBrick.Name.Length > 0 ? editBrick.Name : original.Name; original.Color = editBrick.Color != null ? editBrick.Color : original.Color; original.Description = editBrick.Description.Length > 0 ? editBrick.Description : original.Description; return(_repo.Edit(original)); }
internal Brick Edit(Brick update) { var exists = _repo.GetById(update.Id); if (exists == null) { throw new Exception("Invalid ID"); } _repo.Edit(update); return(update); }
internal Brick Edit(Brick update) { var found = _repo.GetById(update.Id); if (found == null) { throw new Exception("Invalid Id bro"); } //update.AuthorId = found.AuthorId; _repo.Edit(update); return(update); }
internal Brick Edit(Brick editBrick) { Brick original = Get(editBrick.Id); original.Color = editBrick.Color != null ? editBrick.Color : original.Color; original.Name = editBrick.Name != null ? editBrick.Name : original.Name; original.Description = editBrick.Description != null ? editBrick.Description : original.Description; return(_repo.Edit(original)); }