Ejemplo n.º 1
0
        public async Task <IActionResult> Ref([FromBody] UserFilter viewModel)
        {
            CheckFilter(viewModel);
            var query = new UserRefByFilter {
                Filter = viewModel, CurrentUser = CurrentUser
            };
            await DataHandler.Execute(query);

            return(Ok(new PagedResult <IEnumerable <ResultProfile> >
            {
                Data = query.Result, Paging = query.Paging, Success = true
            }));
        }
Ejemplo n.º 2
0
        public async Task UserRefByFilterDataTestAuth()
        {
            var filter = new UserFilter {
                AuthRestrict = true, Take = 10
            };

            using var store   = GetDocumentStore();
            using var session = store.OpenAsyncSession();

            var query = new UserRefByFilter {
                Session = session, Filter = filter, CurrentUser = SuperUser
            };
            await query.Execute();

            query.Result.Should().NotBeNull();
            query.Result.Count().Should().Be(0);
        }
Ejemplo n.º 3
0
        public async Task UserRefByFilterDataTestSearch()
        {
            var filter = new UserFilter {
                Search = "test", Take = 10
            };

            using var store   = GetDocumentStore();
            using var session = store.OpenAsyncSession();

            var query = new UserRefByFilter {
                Session = session, Filter = filter, CurrentUser = StandardUser
            };
            await query.Execute();

            query.Result.Should().NotBeNull();
            query.Result.Count().Should().Be(1);
            query.Result.First().Id.Should().Be(UserData.FirstId);
        }