예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public async Task <IEnumerable <Mesh> > GetMeshes()
 {
     return(await MeshRepository.GetAsync());
 }