public RightsView AddRightsChild(int id, string name, string url, string description, bool isshow) { Rights rights = this._rightsRepository.FindBy(id); if (rights == null) { throw new EntityIsInvalidException <string>(id.ToString()); } Rights result = rights.AddChild(name, url, description, isshow); this._uow.Commit(); return(result.ConvertToRightsView()); }
public RightsView AddRights(AddRightsRequest request) { Rights rights = this._rightsRepository.FindBy(request.ParentId); if (rights == null) { throw new EntityIsInvalidException <string>(request.ParentId.ToString()); } Rights result = rights.AddChild(request.Name, request.Url, request.Description, request.IsShow, request.Icon); this._uow.Commit(); return(result.ConvertToRightsView()); }