Beispiel #1
0
        public override async Task <SearchGroupReply> SearchGroup(SearchGroupRequest request, ServerCallContext context)
        {
            List <UserGroup> groups = await _authDbContext.UserGroup
                                      .AsNoTracking()
                                      .Where(u => u.Name.Contains(request.SearchParameter))
                                      .ToListAsync();

            SearchGroupReply reply = new SearchGroupReply();

            foreach (UserGroup group in groups)
            {
                SearchGroupEntry entry = new SearchGroupEntry
                {
                    Id   = group.Id.ToString(),
                    Name = group.Name,
                };

                reply.Entries.Add(entry);
            }

            return(reply);
        }
Beispiel #2
0
 public async Task <IActionResult> SearchGroup(SearchGroupRequest request, [FromServices] IHandler <SearchGroupRequest, ObjectResult> handler)
 {
     return(await handler.Handle(request));
 }
 public static SearchGroupResult SearchGroup(SearchGroupRequest request)
 {
     return(Request <SearchGroupResult>("group_open_http_svc", "search_group", request));
 }