Added support for MySQL and ProgreSQL and AddSite/Tenant

This commit is contained in:
Charles Nurse
2021-04-02 10:55:00 -07:00
parent 2fb63e8117
commit e6530ee127
57 changed files with 708 additions and 581 deletions

View File

@ -16,6 +16,6 @@ namespace Oqtane.Modules.HtmlText.Repository
{
}
public virtual DbSet<HtmlTextInfo> HtmlText { get; set; }
public virtual DbSet<Models.HtmlText> HtmlText { get; set; }
}
}

View File

@ -13,20 +13,20 @@ namespace Oqtane.Modules.HtmlText.Repository
_db = context;
}
public HtmlTextInfo GetHtmlText(int moduleId)
public Models.HtmlText GetHtmlText(int moduleId)
{
return _db.HtmlText.FirstOrDefault(item => item.ModuleId == moduleId);
}
public HtmlTextInfo AddHtmlText(HtmlTextInfo htmlText)
public Models.HtmlText AddHtmlText(Models.HtmlText htmlText)
{
_db.HtmlText.Add(htmlText);
_db.SaveChanges();
return htmlText;
}
public HtmlTextInfo UpdateHtmlText(HtmlTextInfo htmlText)
public Models.HtmlText UpdateHtmlText(Models.HtmlText htmlText)
{
_db.Entry(htmlText).State = EntityState.Modified;
_db.SaveChanges();
@ -35,7 +35,7 @@ namespace Oqtane.Modules.HtmlText.Repository
public void DeleteHtmlText(int moduleId)
{
HtmlTextInfo htmlText = _db.HtmlText.FirstOrDefault(item => item.ModuleId == moduleId);
Models.HtmlText htmlText = _db.HtmlText.FirstOrDefault(item => item.ModuleId == moduleId);
if (htmlText != null) _db.HtmlText.Remove(htmlText);
_db.SaveChanges();
}

View File

@ -4,9 +4,9 @@ namespace Oqtane.Modules.HtmlText.Repository
{
public interface IHtmlTextRepository
{
HtmlTextInfo GetHtmlText(int moduleId);
HtmlTextInfo AddHtmlText(HtmlTextInfo htmlText);
HtmlTextInfo UpdateHtmlText(HtmlTextInfo htmlText);
Models.HtmlText GetHtmlText(int moduleId);
Models.HtmlText AddHtmlText(Models.HtmlText htmlText);
Models.HtmlText UpdateHtmlText(Models.HtmlText htmlText);
void DeleteHtmlText(int moduleId);
}
}