public void Update(int?id, Component component) { if (read.GetById(id) == null) { throw new NotFoundComponentException(); } update.Update(component); }
public void Delete(int?id) { if (read.GetById(id) == null) { throw new NotFoundComponentException(); } delete.Delete(id); }
private Component GetComponent(int?idComponentWithError) { return(componenRepository.GetById(idComponentWithError) ?? throw new NotFoundComponentException()); }