public ActionResult <ItemResponse <int> > Update(AdvertiserUpdateRequest model)
        {
            int          code     = 200;
            BaseResponse response = null;

            try
            {
                _service.Update(model);

                response = new SuccessResponse();
            }
            catch (Exception ex)
            {
                code     = 500;
                response = new ErrorResponse(ex.Message);
            }
            return(StatusCode(code, response));
        }
Exemplo n.º 2
0
        public void Update(AdvertiserUpdateRequest model)
        {
            string procName = "[dbo].[Advertisers_Update]";

            _data.ExecuteNonQuery(procName,
                                  inputParamMapper : delegate(SqlParameterCollection col)
            {
                col.AddWithValue("@Id", model.Id);
                col.AddWithValue("@ShortTitle", model.ShortTitle);
                col.AddWithValue("@Title", model.Title);
                col.AddWithValue("@ShortDescription", model.ShortDescription);
                col.AddWithValue("@Content", model.Content);
                col.AddWithValue("@CreatedBy", model.CreatedBy);
                col.AddWithValue("@Slug", model.Slug);
                col.AddWithValue("@EntityTypeId", model.EntityTypeId);
                col.AddWithValue("@StatusId", model.StatusId);
                col.AddWithValue("@MetaDataId", model.MetaDataId);
            });
        }