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

@ -46,14 +46,14 @@ namespace Oqtane.Services
return await http.GetJsonAsync<Module>(apiurl + "/" + ModuleId.ToString());
}
public async Task AddModuleAsync(Module module)
public async Task<Module> AddModuleAsync(Module Module)
{
await http.PostJsonAsync(apiurl, module);
return await http.PostJsonAsync<Module>(apiurl, Module);
}
public async Task UpdateModuleAsync(Module module)
public async Task<Module> UpdateModuleAsync(Module Module)
{
await http.PutJsonAsync(apiurl + "/" + module.ModuleId.ToString(), module);
return await http.PutJsonAsync<Module>(apiurl + "/" + Module.ModuleId.ToString(), Module);
}
public async Task DeleteModuleAsync(int ModuleId)