Пример #1
0
        public async Task <IActionResult> PostLibrary([FromBody] LibraryDto dto)
        {
            var dbLibrary = dto.ToDbModel();

            var created = await _libraryRepository.Create(Guid.NewGuid(), dbLibrary.Name, dbLibrary.Address);

            var createdDto = created.ToDto();

            return(Created($"/{createdDto.Id}", createdDto));
        }