Refactored repository pattern for Add and Update methods so that they return their respective entity objects

This commit is contained in:
Shaun Walker
2019-08-05 09:31:04 -04:00
parent b9c007998e
commit 4fda7b17d0
43 changed files with 353 additions and 137 deletions

View File

@ -31,14 +31,14 @@ namespace Oqtane.Services
return await http.GetJsonAsync<List<PageModule>>(apiurl);
}
public async Task AddPageModuleAsync(PageModule pagemodule)
public async Task<PageModule> AddPageModuleAsync(PageModule PageModule)
{
await http.PostJsonAsync(apiurl, pagemodule);
return await http.PostJsonAsync<PageModule>(apiurl, PageModule);
}
public async Task UpdatePageModuleAsync(PageModule pagemodule)
public async Task<PageModule> UpdatePageModuleAsync(PageModule PageModule)
{
await http.PutJsonAsync(apiurl + "/" + pagemodule.PageModuleId.ToString(), pagemodule);
return await http.PutJsonAsync<PageModule>(apiurl + "/" + PageModule.PageModuleId.ToString(), PageModule);
}
public async Task DeletePageModuleAsync(int PageModuleId)