Merge pull request #1239 from cnurse/dev

Implement Database Migrations and add Multi-Database Support
This commit is contained in:
Shaun Walker
2021-04-19 21:11:11 -04:00
committed by GitHub
108 changed files with 4006 additions and 453 deletions

View File

@ -84,7 +84,7 @@
}
else
{
htmltext = new HtmlTextInfo();
htmltext = new HtmlText();
htmltext.ModuleId = ModuleState.ModuleId;
htmltext.Content = content;
await HtmlTextService.AddHtmlTextAsync(htmltext);

View File

@ -19,18 +19,18 @@ namespace Oqtane.Modules.HtmlText.Services
private string ApiUrl => CreateApiUrl(_siteState.Alias, "HtmlText");
public async Task<HtmlTextInfo> GetHtmlTextAsync(int moduleId)
public async Task<Models.HtmlText> GetHtmlTextAsync(int moduleId)
{
var htmltext = await GetJsonAsync<List<HtmlTextInfo>>(CreateAuthorizationPolicyUrl($"{ApiUrl}/{moduleId}", moduleId));
var htmltext = await GetJsonAsync<List<Models.HtmlText>>(CreateAuthorizationPolicyUrl($"{ApiUrl}/{moduleId}", moduleId));
return htmltext.FirstOrDefault();
}
public async Task AddHtmlTextAsync(HtmlTextInfo htmlText)
public async Task AddHtmlTextAsync(Models.HtmlText htmlText)
{
await PostJsonAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}", htmlText.ModuleId), htmlText);
}
public async Task UpdateHtmlTextAsync(HtmlTextInfo htmlText)
public async Task UpdateHtmlTextAsync(Models.HtmlText htmlText)
{
await PutJsonAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}/{htmlText.HtmlTextId}", htmlText.ModuleId), htmlText);
}

View File

@ -6,11 +6,11 @@ namespace Oqtane.Modules.HtmlText.Services
{
public interface IHtmlTextService
{
Task<HtmlTextInfo> GetHtmlTextAsync(int ModuleId);
Task<Models.HtmlText> GetHtmlTextAsync(int ModuleId);
Task AddHtmlTextAsync(HtmlTextInfo htmltext);
Task AddHtmlTextAsync(Models.HtmlText htmltext);
Task UpdateHtmlTextAsync(HtmlTextInfo htmltext);
Task UpdateHtmlTextAsync(Models.HtmlText htmltext);
Task DeleteHtmlTextAsync(int ModuleId);
}