示例#1
0
        public object GetVendors()
        {
            var temp   = new GetVendorsRequest();
            var result = temp.RunRequest();

            return(result);
        }
        public async Task <IHttpActionResult> Get()
        {
            //var request = new GetVendorsRequest() { TenantId = (await _userManager.GetUserAsync(User)).TenantId };
            var request = new GetVendorsRequest()
            {
                TenantId = 1
            };

            return(Ok(await _mediator.Send(request)));
        }
示例#3
0
        public List <Vendr> All()
        {
            var          result         = new GetVendorsRequest().Execute(Api.Client);
            var          fetchedVendors = result.Data.Vendors;
            List <Vendr> vendors        = new List <Vendr>();

            if (result.Status == 200)
            {
                for (int i = 0; i < fetchedVendors.Count; i++)
                {
                    Vendr tempVendor = new Vendr();
                    tempVendor.UpdateFromRequest(Utils.DictionaryOfJsonFields(fetchedVendors[i]));
                    vendors.Add(tempVendor);
                }
            }
            return(vendors);
        }