Ejemplo n.º 1
0
 public BaseResponse InsertOwnerPrivilege(Requests.FileManagerRolePrivilege.FilePrivilegeRequest request)
 {
     BaseResponse response = new BaseResponse();
     try
     {
         var privilege = request.MapTo<FileManagerRolePrivilege>();
         DataContext.FileManagerRolePrivileges.Add(privilege);
         DataContext.SaveChanges();
         response.IsSuccess = true;
     }
     catch (InvalidOperationException inval)
     {
         response.Message = inval.Message;
     }
     catch (ArgumentNullException arg)
     {
         response.Message = arg.Message;
     }
     return response;
 }