Пример #1
0
        public async Task <PlacesRegisterResponseModel> CreatePlace(PlacesRegisterRequestModel registerRequestModel)
        {
            var place = new Places
            {
                Name = registerRequestModel.Name
            };

            var createdPlace = await _placeRepository.AddAsync(place);

            var createdPlaceResponseModel = new PlacesRegisterResponseModel
            {
                Id   = createdPlace.Id,
                Name = createdPlace.Name
            };

            return(createdPlaceResponseModel);
        }
Пример #2
0
        public async Task <IActionResult> CreatePlace(PlacesRegisterRequestModel model)
        {
            var place = await _placesService.CreatePlace(model);

            return(Ok(place));
        }