Improve validation and error handling in Controller methods

This commit is contained in:
Shaun Walker
2021-06-07 15:29:08 -04:00
parent 54cd360bb5
commit 82c05a841f
38 changed files with 922 additions and 435 deletions

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -9,6 +9,7 @@ namespace Oqtane.Repository
Module AddModule(Module module);
Module UpdateModule(Module module);
Module GetModule(int moduleId);
Module GetModule(int moduleId, bool tracking);
void DeleteModule(int moduleId);
string ExportModule(int moduleId);
bool ImportModule(int moduleId, string content);

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -9,6 +9,7 @@ namespace Oqtane.Repository
Notification AddNotification(Notification notification);
Notification UpdateNotification(Notification notification);
Notification GetNotification(int notificationId);
Notification GetNotification(int notificationId, bool tracking);
void DeleteNotification(int notificationId);
}
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -10,6 +10,7 @@ namespace Oqtane.Repository
PageModule AddPageModule(PageModule pageModule);
PageModule UpdatePageModule(PageModule pageModule);
PageModule GetPageModule(int pageModuleId);
PageModule GetPageModule(int pageModuleId, bool tracking);
PageModule GetPageModule(int pageId, int moduleId);
void DeletePageModule(int pageModuleId);
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -9,6 +9,7 @@ namespace Oqtane.Repository
Page AddPage(Page page);
Page UpdatePage(Page page);
Page GetPage(int pageId);
Page GetPage(int pageId, bool tracking);
Page GetPage(int pageId, int userId);
Page GetPage(string path, int siteId);
void DeletePage(int pageId);

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -9,6 +9,7 @@ namespace Oqtane.Repository
Profile AddProfile(Profile profile);
Profile UpdateProfile(Profile profile);
Profile GetProfile(int profileId);
Profile GetProfile(int profileId, bool tracking);
void DeleteProfile(int profileId);
}
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -10,6 +10,7 @@ namespace Oqtane.Repository
Role AddRole(Role role);
Role UpdateRole(Role role);
Role GetRole(int roleId);
Role GetRole(int roleId, bool tracking);
void DeleteRole(int roleId);
}
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -9,6 +9,7 @@ namespace Oqtane.Repository
Site AddSite(Site site);
Site UpdateSite(Site site);
Site GetSite(int siteId);
Site GetSite(int siteId, bool tracking);
void DeleteSite(int siteId);
void CreatePages(Site site, List<PageTemplate> pageTemplates);
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Oqtane.Models;
namespace Oqtane.Repository
@ -9,6 +9,7 @@ namespace Oqtane.Repository
User AddUser(User user);
User UpdateUser(User user);
User GetUser(int userId);
User GetUser(int userId, bool tracking);
User GetUser(string username);
void DeleteUser(int userId);
}

View File

@ -10,6 +10,7 @@ namespace Oqtane.Repository
UserRole AddUserRole(UserRole userRole);
UserRole UpdateUserRole(UserRole userRole);
UserRole GetUserRole(int userRoleId);
UserRole GetUserRole(int userRoleId, bool tracking);
void DeleteUserRole(int userRoleId);
void DeleteUserRoles(int userId);
}