introduce ITransientService interface for auto registration of transient services (for DBContexts and Repositories)

This commit is contained in:
Shaun Walker
2022-07-26 09:41:42 -04:00
parent e61a6df4d7
commit 5762ce58a4
10 changed files with 35 additions and 15 deletions

View File

@ -11,7 +11,7 @@ using Oqtane.Repository.Databases.Interfaces;
namespace Oqtane.Modules.HtmlText.Repository
{
[PrivateApi("Mark HtmlText classes as private, since it's not very useful in the public docs")]
public class HtmlTextContext : DBContextBase, IService, IMultiDatabase
public class HtmlTextContext : DBContextBase, ITransientService, IMultiDatabase
{
public HtmlTextContext(ITenantManager tenantManager, IHttpContextAccessor httpContextAccessor) : base(tenantManager, httpContextAccessor) { }

View File

@ -1,13 +1,11 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using Oqtane.Modules.HtmlText.Models;
using Oqtane.Documentation;
using System.Collections.Generic;
namespace Oqtane.Modules.HtmlText.Repository
{
[PrivateApi("Mark HtmlText classes as private, since it's not very useful in the public docs")]
public class HtmlTextRepository : IHtmlTextRepository, IService
public class HtmlTextRepository : IHtmlTextRepository, ITransientService
{
private readonly HtmlTextContext _db;