public async Task <IActionResult> CreateRestaurantCategory([FromBody] CreateRestaurantCategoryRequest createRestaurantCategoryRequest) { var newRestaurantCategoryId = new Guid(); var restaurantCategory = new RestaurantCategory { Id = newRestaurantCategoryId, RestaurantCategoryName = createRestaurantCategoryRequest.RestaurantCategoryName }; await _restaurantCategoryService .CreateRestaurantCategoryAsync(restaurantCategory); /*var locationUri = _uriService.GetRestaurantUri(restaurant.Id.ToString()); * return Created(locationUri, new Response<RestaurantResponse>(_mapper.Map<RestaurantResponse>(restaurant)));*/ return(Ok(new Response <RestaurantCategoryResponse>(_mapper.Map <RestaurantCategoryResponse>(restaurantCategory)))); }
protected async Task <RestaurantCategoryResponse> CreateRestaurantCategoryAsync(CreateRestaurantCategoryRequest request) { var response = await TestClient.PostAsJsonAsync(ApiRoutes.RestaurantsCategories.Create, request); return((await response.Content.ReadAsAsync <Response <RestaurantCategoryResponse> >()).Data); }