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())); }
public void Add(EnvironmentDto environmentDto) { environments.Add(Environment.FromDto(environmentDto)); }