示例#1
0
        public HttpResponseMessage Update(HttpRequestMessage request, GroupProductViewModel vm)
        {
            string message = "";
            var    srv     = IoC.Resolve <IGroupProductCategoryService>();
            var    model   = vm.UpdateModel(srv.GetbyKey(vm.Id));

            if (srv.Update(model, out message))
            {
                return(request.CreateResponse(HttpStatusCode.OK, srv.GetAll()));
            }
            return(request.CreateResponse(HttpStatusCode.BadRequest, message));
        }