Exemplo n.º 1
0
 public void Update(SocialMediaUpdateRequest model)
 {
     this.DataProvider.ExecuteNonQuery(
         "SocialMedia_Update",
         inputParamMapper : delegate(SqlParameterCollection paramCol)
     {
         paramCol.AddWithValue("@Id", model.Id);
         paramCol.AddWithValue("@Url", model.Url);
         paramCol.AddWithValue("@SocialMediaTypeId", model.SocialMediaTypeId);
         paramCol.AddWithValue("@ModifiedBy", model.ModifiedBy);
     },
         returnParameters: null
         );
 }
Exemplo n.º 2
0
 public HttpResponseMessage Put(SocialMediaUpdateRequest model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             IUserAuthData currentUser = _principal.Identity.GetCurrentUser();
             model.ModifiedBy = currentUser.Name;
             _socialMediaServices.Update(model);
             SuccessResponse resp = new SuccessResponse();
             return(Request.CreateResponse(HttpStatusCode.OK, resp));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }