public VParameter Update(VParameter vParameter)
        {
            var parameter = mapper.Map <Parameter>(vParameter);

            parameterRepository.Update(parameter).Save();

            return(mapper.Map <VParameter>(parameter));
        }
        public VParameter Insert(VParameter vParameter)
        {
            var parameter = mapper.Map <Parameter>(vParameter);

            parameter.UserCreated = "Test";
            parameter.Id          = 0;

            parameterRepository.Insert(parameter).Save();

            return(mapper.Map <VParameter>(parameter));
        }
 public ActionResult Put(VParameter vParameter)
 {
     try
     {
         if (ModelState.ErrorCount == 0)
         {
             return(Ok(this.ParameterBusiness.Update(vParameter)));
         }
         else
         {
             return(BadRequest(ModelState));
         }
     }
     catch (Exception ex)
     {
         return(Conflict(ex.InnerException));
     }
 }
 public ActionResult Post(VParameter vParameter)
 {
     try
     {
         if (ModelState.ErrorCount == 0)
         {
             return(Created(Request.Path.Value, this.ParameterBusiness.Insert(vParameter)));
         }
         else
         {
             return(BadRequest(ModelState));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.InnerException));
     }
 }