Beispiel #1
0
 public async Task<HttpResponseMessage> PostVariable(Guid id, VariableSaveRequest variable)
 {
     await _componentsRepository.SaveVariable(new Variable
     {
         Id = id,
         Name = variable.Name,
         Description = variable.Description,
         Sets = variable.Sets,
         Constraint = variable.Constraint == null ? null : new VariableContstraint
         {
             Operator = (VariableContstraintOperator)Enum.Parse(typeof(VariableContstraintOperator), variable.Constraint.Operator),
             Value = variable.Constraint.Value
         },
         Integer = variable.Integer,
     });
     return Request.CreateResponse(HttpStatusCode.OK);
 }
Beispiel #2
0
        public async Task <HttpResponseMessage> PostVariable(Guid id, VariableSaveRequest variable)
        {
            await _modelRepository.SaveVariable(new Variable
            {
                Id          = id,
                Name        = variable.Name,
                Description = variable.Description,
                Sets        = variable.Sets,
                Constraint  = variable.Constraint == null ? null : new VariableContstraint
                {
                    Operator = (VariableContstraintOperator)Enum.Parse(typeof(VariableContstraintOperator), variable.Constraint.Operator),
                    Value    = variable.Constraint.Value
                },
                Integer = variable.Integer,
            });

            return(Request.CreateResponse(HttpStatusCode.OK));
        }