public List <GroupTableModel> Search(GroupQueryModel query, Guid languageId) { using (var command = Context.Connection.GenerateCommand( "ais.search_organization", query, new Dictionary <string, object> { { "planguageid", languageId } })) { var result = new List <GroupTableModel>(); using (var reader = command.ExecuteReaderSafety()) { while (reader.Read()) { result.Add( new GroupTableModel { Id = reader.GetFieldValue <Guid>("id"), GeoNetworkId = reader.GetFieldValue <long?>("geonetworkid"), Email = reader.GetFieldValue <string>("email"), Bulstat = reader.GetFieldValue <string>("bulstat"), Name = reader.GetFieldValue <string>("name"), ContactPerson = reader.GetFieldValue <string>("contactperson") }); } } return(result); } }
public async Task <IResultModel> Query(GroupQueryModel model) { var result = new QueryResultModel <GroupEntity> { Rows = await _repository.Query(model), Total = model.TotalCount }; return(ResultModel.Success(result)); }
public async Task <IList <GroupEntity> > Query(GroupQueryModel model) { var paging = model.Paging(); var query = Db.Find(); if (!paging.OrderBy.Any()) { query.OrderByDescending(m => m.Id); } var result = await query.LeftJoin <AccountEntity>((x, y) => x.CreatedBy == y.Id) .Select((x, y) => new { x, Creator = y.Name }) .PaginationAsync(paging); model.TotalCount = paging.TotalCount; return(result); }
public async Task <IList <GroupEntity> > Query(GroupQueryModel model) { var paging = model.Paging(); var query = Db.Find(); query.WhereNotNull(model.Name, m => m.Name.Contains(model.Name)); query.WhereNotNull(model.Code, m => m.Code.Contains(model.Code)); var joinQuery = query.LeftJoin <AccountEntity>((x, y) => x.CreatedBy == y.Id); if (!paging.OrderBy.Any()) { joinQuery.OrderByDescending((x, y) => x.Id); } joinQuery.Select((x, y) => new { x, Creator = y.Name }); var result = await joinQuery.PaginationAsync(paging); model.TotalCount = paging.TotalCount; return(result); }
public Task <IResultModel> Query([FromQuery] GroupQueryModel model) { return(_service.Query(model)); }
public List <GroupTableModel> Search(GroupQueryModel query) { return(groupRepository.Search(query, RequestData.LanguageId)); }