Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 3
0
 public async Task <IEnumerable <Mesh> > GetMeshes()
 {
     return(await MeshRepository.GetAsync());
 }