public async Task <IActionResult> PostMeshSettings([FromBody] MeshSettings meshSettings) { meshSettings.LogicalName = "experiment_settings"; meshSettings.CreatedOn = DateTime.Now; meshSettings.Mesh = await MeshRepository.GetAsync(meshSettings.MeshId); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } meshSettings = await MeshService.CreateSettingsAsync(meshSettings); return(CreatedAtAction("GetMeshSettings", new { id = meshSettings.Id }, meshSettings)); }
public async Task <IActionResult> GetMesh([FromQuery] Guid id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var mesh = await MeshRepository.GetAsync(id); if (mesh == null) { return(NotFound()); } return(Ok(mesh)); }
public async Task <IEnumerable <Mesh> > GetMeshes() { return(await MeshRepository.GetAsync()); }