public IEnumerable <BuilderDefine> TemplateList(int template, BuilderDefineTypes type) { var query = _db.Set <BuilderDefine>(); return(query.Where(e => e.Type == type && e.TemplateId == template) .ToArray()); }
public IEnumerable <BuilderDefine> List(BuilderDefineTypes type) { var query = _db.Set <BuilderDefine>(); return(query.Where(e => e.Type == type && !e.TemplateId.HasValue) .ToArray()); }
public BuilderDefine TemplateGet(int template, BuilderDefineTypes type, int id) { return(_db.Set <BuilderDefine>().FirstOrDefault(e => e.Id == id && e.Type == type && e.TemplateId == template)); }
public BuilderDefine Get(BuilderDefineTypes type, int id) { return(_db.Set <BuilderDefine>().FirstOrDefault(e => e.Id == id && e.Type == type && !e.TemplateId.HasValue)); }