load module settings automatically so that they are part of the ModuleState and can be easily accessed by developers

This commit is contained in:
Shaun Walker
2020-11-04 15:40:57 -05:00
parent 700b6e2d68
commit 97cec46ec1
4 changed files with 25 additions and 6 deletions

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Oqtane.Models;
@ -14,6 +14,11 @@ namespace Oqtane.Repository
_db = context;
}
public IEnumerable<Setting> GetSettings(string entityName)
{
return _db.Setting.Where(item => item.EntityName == entityName);
}
public IEnumerable<Setting> GetSettings(string entityName, int entityId)
{
return _db.Setting.Where(item => item.EntityName == entityName)