public ActionResult Create([FromHeader] Guid apiKey, [FromBody] EnvironmentDto environment)
        {
            var id = Guid.NewGuid();

            if (environment is null)
            {
                return(BadRequest());
            }
            var env = Environment.FromDto(environment);

            env.Id = id;
            publisher.Add(env);
            return(Created($"/environment/{id}", env.ToDto()));
        }
예제 #2
0
 public void Add(EnvironmentDto environmentDto)
 {
     environments.Add(Environment.FromDto(environmentDto));
 }