public static EntityQuery GetEntityQuery(EntityQuery entityQuery) { try { var getListEntityDao = new GetListEntityDao(); if (entityQuery.IsNotGetValue) { return(entityQuery); //Lấy maxKey mà không lấy dữ liệu } entityQuery.ReturnValue = getListEntityDao.Select(entityQuery).Select(c => new Entity.Entity(c)).ToList(); } catch (Exception ex) { LogTo.Error(ex.ToString()); } return(entityQuery); }
//Hàm này hiện tại sử dụng cho các worker gửi message sang lấy dữ liệu public static List <EntityQuery> GetListEntityQuery(List <EntityQuery> listEntityQuery) { try { //isGetRef = false tuc la chi dinh lay bang nao thi select bang do (Dung cho lay bang working ko lay bang hist) var getListEntityDao = new GetListEntityDao(); foreach (var entityQuery in listEntityQuery) { if (entityQuery.IsNotGetValue) { continue; //Lấy maxKey mà không lấy dữ liệu } entityQuery.ReturnValue = getListEntityDao.Select(entityQuery).Select(c => new Entity.Entity(c)).ToList(); } } catch (Exception ex) { LogTo.Error(ex.ToString()); return(null); //Không cho phép ready worker khi không lấy được thông tin } return(listEntityQuery); }