コード例 #1
0
        public SearchContactsResponseViewModel SearchContacts(SearchContactsRequestViewModel request)
        {
            SearchContactsResponseViewModel responseViewModel = new SearchContactsResponseViewModel();
            List <ContactInfoModel>         contactInfoModels = _searchContactsServiceBll.SearchContacts(request.SearchArgs, request.Cid);

            responseViewModel.ContactList = Mapper.Map <List <ContactInfoModel>, List <ContactViewModel> >(contactInfoModels);

            return(responseViewModel);
        }
コード例 #2
0
        public async Task <ResponseBaseViewModel <SearchContactsResponseViewModel> > SearchContacts(
            [FromBody] SearchContactsRequestViewModel request)
        {
            request.Cid = this.GetCid();
            SearchContactsResponseViewModel viewModel = new SearchContactsResponseViewModel();

            await new TaskFactory().StartNew(() =>
            {
                viewModel = _searchContactsApplication.SearchContacts(request);
            });

            ResponseBaseViewModel <SearchContactsResponseViewModel> v = new ResponseBaseViewModel
                                                                        <SearchContactsResponseViewModel>
            {
                Flag = new ResponseCodeViewModel()
                {
                    Code = 0, MojoryToken = this.GetToken()
                },
                Data = viewModel
            };

            return(v);
        }