35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using DG.EntityFramework;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Zxd.Domain
|
|
{
|
|
public class BasParameterDomain : IBasParameterDomain
|
|
{
|
|
private readonly IRepositoryBase<ZxdDbContext, BAS_PARAMETER> _parameterRepository;
|
|
private readonly IBaseRepository<ZxdDbContext> _repository;
|
|
|
|
public BasParameterDomain(IBaseRepository<ZxdDbContext> repository)
|
|
{
|
|
_repository = repository;
|
|
_parameterRepository = _repository.GetRepository<BAS_PARAMETER>();
|
|
}
|
|
|
|
public string GetParameterValue(string paraKey)
|
|
{
|
|
BAS_PARAMETER param = _parameterRepository.Query().FirstOrDefault(m => m.PARAKEY == paraKey);
|
|
if (param == null)
|
|
return "";
|
|
return param.PARAVALUE;
|
|
}
|
|
|
|
public BAS_PARAMETER GetModel(string paraKey)
|
|
{
|
|
BAS_PARAMETER param = _parameterRepository.Query().FirstOrDefault(m => m.PARAKEY == paraKey);
|
|
return param;
|
|
}
|
|
}
|
|
} |