Exemplo n.º 1
0
        private async Task LoadMembers()
        {
            var command = new MemberSelectQuery(User, Tenant.Value.Id);
            var members = await Mediator.Send(command);

            Members = members
                      .OrderBy(m => m.SortName)
                      .ToList();
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync()
        {
            var command = new MemberSelectQuery(User, Tenant.Value.Id);
            var members = await Mediator.Send(command);

            var exported = _mapper.Map <List <MemberImportModel> >(members);

            var fileName = $"Members-{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.csv";

            return(Export(exported, fileName));
        }
Exemplo n.º 3
0
        private async Task LoadMembers()
        {
            var command = new MemberSelectQuery(User, Tenant.Value.Id);

            command.RoleId = Core.Data.Constants.Role.Attendee;

            var members = await Mediator.Send(command);

            Members = members
                      .OrderBy(m => m.SortName)
                      .ToList();
        }
Exemplo n.º 4
0
        private async Task <IReadOnlyCollection <MemberDropdownModel> > LoadMembers()
        {
            var command = new MemberSelectQuery(User, Tenant.Value.Id);

            command.RoleId = Core.Data.Constants.Role.Attendee;

            var members = await Mediator.Send(command);

            return(members
                   .OrderBy(m => m.SortName)
                   .Select(m => new MemberDropdownModel
            {
                Value = m.UserName,
                Text = m.SortName
            })
                   .ToList());
        }
Exemplo n.º 5
0
        protected override async Task <IReadOnlyCollection <MemberReadModel> > Process(MemberSelectQuery request, CancellationToken cancellationToken)
        {
            // users that are members for tenant
            var query = UserQuery(request.TenantId, request.RoleId);

            var result = await query
                         .AsNoTracking()
                         .OrderBy(p => p.DisplayName)
                         .ProjectTo <MemberReadModel>(Mapper.ConfigurationProvider)
                         .ToListAsync(cancellationToken)
                         .ConfigureAwait(false);

            return(result);
        }