コード例 #1
0
ファイル: HeelController.cs プロジェクト: war-man/TheShoes
        public HttpResponseMessage GetAll(HttpRequestMessage request)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;
                var model = _heelService.GetAll();
                IEnumerable <HeelViewModel> modelVm = Mapper.Map <IEnumerable <Heel>, IEnumerable <HeelViewModel> >(model);

                response = request.CreateResponse(HttpStatusCode.OK, modelVm);

                return response;
            }));
        }
コード例 #2
0
ファイル: ProductController.cs プロジェクト: war-man/TheShoes
 public ActionResult ListByTag(string tagId)
 {
     ViewBag.Tags      = _commonService.GetById(tagId);
     ViewBag.Types     = Mapper.Map <IEnumerable <Model.Models.Type>, IEnumerable <TypeViewModel> >(_typeService.GetAll());
     ViewBag.Heels     = Mapper.Map <IEnumerable <Heel>, IEnumerable <HeelViewModel> >(_heelService.GetAll());
     ViewBag.Heights   = Mapper.Map <IEnumerable <Height>, IEnumerable <HeightViewModel> >(_heightService.GetAll());
     ViewBag.Providers = Mapper.Map <IEnumerable <Provider>, IEnumerable <ProviderViewModel> >(_providerService.GetAll());
     ViewBag.Colors    = Mapper.Map <IEnumerable <Color>, IEnumerable <ColorViewModel> >(_colorService.GetAll());
     ViewBag.Materials = Mapper.Map <IEnumerable <Material>, IEnumerable <MaterialViewModel> >(_commonService.GetMaterial());
     return(View());
 }