public async Task <HttpResponseMessage> PostVariable(Guid id, ObjectiveFunctionSaveRequest objectiveFunction) { await _componentsRepository.SaveObjectiveFunction(new ObjectiveFunction { Id = id, Name = objectiveFunction.Name, Description = objectiveFunction.Description, Function = (ObjectiveFunctionFunction)Enum.Parse(typeof(ObjectiveFunctionFunction), objectiveFunction.Function), Equation = objectiveFunction.Equation.ToEquationObject(), }); return(Request.CreateResponse(HttpStatusCode.OK)); }