public IList <string> Handle(GetAreasQuery theQuery) { var session = BuildSession(); var query = session.QueryOver <ActionAccessPrivilege>() .Select(Projections.Distinct(Projections.Property <ActionAccessPrivilege>(x => x.Area))); return(query.List <string>()); }
public async Task <IEnumerable <LookupDto> > Handle(GetAreasQuery request, CancellationToken cancellationToken) { return(await _db.Area.Select(a => new LookupDto() { Id = a.Id, Name = a.Name, IsActive = a.IsActive, CreatedBy = a.CreatedBy, CreatedDate = a.CreatedDate, LastModifiedBy = a.LastModifiedBy, LastModifiedDate = a.LastModifiedDate, }).ToListAsync(cancellationToken: cancellationToken)); }