Exemplo n.º 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,
                Unit    = variable.Unit,
            });

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