public RaitingBooksModel Update(RaitingBooksViewModel model, string userId) { if (model != null && userId != null) { RaitingBooksModel updateModel = model; updateModel.UserId = userId; var result = _raitingBooksRepository.UpdateRaiting(updateModel); return(result); } else { throw new Exception("Данный заполенны не полностью"); } }
public RaitingBooksModel Create(RaitingBooksViewModel model, string userId) { if (model != null && userId != null) { RaitingBooksModel createModel = model; createModel.UserId = userId; var result = _raitingBooksRepository.Create(createModel); return(result); } else { throw new Exception("Данные заполнены не полностью"); } }