using Sugar.Enties;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

/// <summary>
/// 数据字典主表子表功能
/// </summary>
public class DictionaryNameManager : DbContext<DictionaryName>
{

    //当前类已经继承了 DbContext增、删、查、改的方法

    //这里面写的代码不会给覆盖,如果要重新生成请删除 DictionaryNameManager.cs

    public DictionaryName GetDictionaryName(string name)
    {
        var entity = DictionaryNameDb.GetList(m => m.dnNAME == name).FirstOrDefault();
        return entity;
    }
    /// <summary>
    /// 根据lambda条件获取数据词典项
    /// </summary>
    /// <param name="lambda"></param>
    /// <returns></returns>
    public List<DictionaryItem> GetDictionaryItems(Expression<Func<DictionaryItem, bool>> lambda)
    {
        return DictionaryItemDb.GetList(lambda);
    }





}
