예제 #1
0
 public bool isAvailable(string name)
 {
     using (var db = new KYCAIS_DEVEntities())
     {
         return(db.mainEntities.Any((q => q.name.ToLower().Contains(name.ToLower()))));
     }
 }
예제 #2
0
 public List <SearchSitesModel> getAllSites()
 {
     using (var db = new KYCAIS_DEVEntities())
     {
         return(db.search_sites
                .AsNoTracking()
                .Where(q => q.source != null)
                .Select(s => new SearchSitesModel
         {
             id = s.id,
             name = s.name,
             url = s.url,
             source = s.source,
             appendString = s.appendString
         })
                .OrderBy(q => q.id)
                .ToList());
     }
 }
예제 #3
0
 public MainEntityModel getEntity(string name)
 {
     using (var db = new KYCAIS_DEVEntities())
     {
         return(db.mainEntities
                .AsNoTracking()
                .Where(q => q.name.ToLower().Contains(name.ToLower()))
                .Select(s => new MainEntityModel
         {
             id = s.id,
             name = s.name,
             subEntities = s.subEntities.Select(q => new SubEntityModel
             {
                 id = q.id,
                 name = q.name
             }).ToList()
         })
                .SingleOrDefault());
     }
 }