public async Task <ApplicationCore.Models.Response.Places> GetById(int id) { var place = await _placesRepository.GetByIdAsync(id); ApplicationCore.Models.Response.Places places = new ApplicationCore.Models.Response.Places() { PlaceId = place.PlaceId, PlaceName = place.PlaceName, Bookings = BookingsConverter(place.Bookings), BookingsHistories = BookingsHistoryConverter(place.BookingsHistories) }; return(places); }
public async Task <ApplicationCore.Models.Response.Places> Add(ApplicationCore.Models.Request.Places request) { Places place = new Places() { PlaceName = request.PlaceName }; var places = await _placesRepository.AddAsync(place); ApplicationCore.Models.Response.Places placesResponse = new ApplicationCore.Models.Response.Places() { PlaceName = places.PlaceName, PlaceId = places.PlaceId }; return(placesResponse); }