示例#1
0
 public EnumType GetByFieldName(string fieldName)
 {
     using (var context = UnitOfWork.Get(Unity.ContainerName))
     {
         var r = new EnumsRepository(context);
         return(r.GetEnumTypes().SingleOrDefault(p => p.NameEn.Equals(fieldName, StringComparison.InvariantCultureIgnoreCase)));
     }
 }
示例#2
0
 public List <EnumValue> Query(string fieldName)
 {
     using (var context = UnitOfWork.Get(Unity.ContainerName))
     {
         var r  = new EnumsRepository(context);
         var q1 = r.GetEnumTypes();
         var q2 = r.GetEnumValues();
         var q  = from p in q1
                  join c in q2
                  on p.Id equals c.TypeId
                  where p.NameEn == fieldName
                  select c;
         return(q.ToList());
     }
 }