public static void UpdatePostCateGory(this PostCateGory p1, PostCateGoryViewModel p2)
 {
     p1.id             = p2.id;
     p1.name           = p2.name;
     p1.alias          = p2.alias;
     p1.displayoder    = p2.displayoder;
     p1.metaDesciption = p2.metaDesciption;
     p1.image          = p2.image;
     p1.metakeyword    = p2.metakeyword;
     p1.status         = p2.status;
     p1.parentid       = p2.parentid;
     p1.homeflag       = p2.homeflag;
     p1.createdat      = p2.createdat;
     p1.createby       = p2.createby;
     p1.updatedat      = p2.updatedat;
     p1.updateby       = p2.updateby;
 }
Exemple #2
0
        public HttpResponseMessage Update(HttpResponseMessage request, PostCateGoryViewModel value)
        {
            HttpResponseMessage response = null;

            if (ModelState.IsValid)
            {
            }
            else
            {
                var postcategoryD = _iPostCateGoryService.GetSingleByid(value.id);
                postcategoryD.UpdatePostCateGory(value);
                _iPostCateGoryService.Update(postcategoryD);
                _iPostCateGoryService.SaveChange();
                response = Request.CreateResponse(HttpStatusCode.OK, value);
            }

            return(response);
        }
Exemple #3
0
        public HttpResponseMessage Create(HttpResponseMessage request, PostCateGoryViewModel value)
        {
            HttpResponseMessage response = null;

            if (ModelState.IsValid)
            {
            }
            else
            {
                PostCateGory key = new PostCateGory();
                key.UpdatePostCateGory(value);
                _iPostCateGoryService.Add(key);
                _iPostCateGoryService.SaveChange();
                response = Request.CreateResponse(HttpStatusCode.Created, value);
            }

            return(response);
        }