public async Task <IActionResult> PostLayout([FromBody] CreateLayout command) { await rules .NoDuplicateLayoutName() .Apply(command, ModelState); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var createdLayoutId = await service.Execute(command); var uri = Url.Action("Get", new { id = createdLayoutId }); return(Created(uri, new LayoutDto { LayoutId = createdLayoutId, LayoutName = command.LayoutName, Tags = command.Tags.ToList(), Items = new List <LayoutItemDto>() })); }