private void Awake() { if (inst == null) { inst = this; } }
public IActionResult PostStage([FromBody] StagesModel Model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!_stageRepository.CreateStages(Model)) { ModelState.AddModelError("", $"Something went wrong saving the job " + $"{Model.Name}"); return(StatusCode(500, ModelState)); } return(Ok(new { Stage = Model.Name, stageCreated = true })); }
public IActionResult PutStage([FromRoute] int id, [FromBody] StagesModel Model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != Model.Id) { return(BadRequest()); } if (!_stageRepository.UpdateStages(Model)) { ModelState.AddModelError("", $"Something went wrong updating the Product " + $"{Model.Name}"); return(StatusCode(500, ModelState)); } return(NoContent()); }