public async Task <IActionResult> AddVenueDetailsAsync([FromBody] VenueInventoryDTO VenueInventoryDTO) { Guard.Against.NullItem <VenueInventoryDTO>(VenueInventoryDTO); //===============Initialize Objects================================================== Guid venueID = Guid.NewGuid(); Guid inventoryID = Guid.NewGuid(); VenueDetail venueDetail = new VenueDetail { VenueID = venueID, VenueName = VenueInventoryDTO.VenueName, VenueCity = VenueInventoryDTO.VenueCity, VenueState = VenueInventoryDTO.VenueState, ContactNumber = VenueInventoryDTO.ContactNumber, IsActive = true, InventoryDetails = new InventoryDetail { VenueID = venueID, InventoryID = inventoryID, AirConditioningType = VenueInventoryDTO.AirConditioningType, Description = VenueInventoryDTO.Description, HourlyRate = VenueInventoryDTO.HourlyRate, IsCoffeeVendingMachineAvailable = VenueInventoryDTO.IsCoffeeVendingMachineAvailable, IsFoodVendingMachineAvailable = VenueInventoryDTO.IsFoodVendingMachineAvailable, IsWaterVendingMachineAvailable = VenueInventoryDTO.IsWaterVendingMachineAvailable, NumberOfMicroPhones = VenueInventoryDTO.NumberOfPhones, NumberOfPhones = VenueInventoryDTO.NumberOfPhones, NumberOfProjectors = VenueInventoryDTO.NumberOfProjectors, RoomType = VenueInventoryDTO.RoomType, SeatCapacity = VenueInventoryDTO.SeatCapacity, WirelessNetworkType = VenueInventoryDTO.WirelessNetworkType } }; //====================Insert now into the database======================= await _venueService.AddNewVenueAsync(venueDetail); return(StatusCode(201, new { message = $"Venue {venueDetail.VenueName} added successfully on {DateTime.Now.ToString("o")}." })); }