public async Task <Team> CreateTeamAsync(Team team)
        {
            if (team == null)
            {
                throw new ArgumentNullException(nameof(team));
            }

            var newTeam = await inner.CreateTeamAsync(team);

            await SetCacheControlResponseAsync(newTeam);

            return(newTeam);
        }
Beispiel #2
0
        public async Task <IActionResult> Create(
            TeamRequestV1 payload,
            ApiVersion version)
        {
            var dto    = payload.MapCreatedToDto(DateTimeOffset.UtcNow, Guid.NewGuid());
            var result = await teamsStore.CreateTeamAsync(dto);

            return(CreatedAtRoute(
                       nameof(GetOne),
                       new
            {
                version = $"{version}",
                id = result.Id
            }, result.MapFromDto()));
        }