public async Task MakeReservation(TimeslotReservationDTO reservation) { dynamic client = new System.Dynamic.ExpandoObject(); client.clientName = reservation.ClientName; client.clientPhone = reservation.ClientPhone; var postObject = new Dictionary <string, dynamic> { { reservation.Time, client } }; var dataString = JsonConvert.SerializeObject(postObject); await _firebase.Child("reservation") .Child(reservation.MonthName) .Child(reservation.MonthId) .Child("Days") .Child(reservation.Day) .PostAsync(dataString); }
public async Task Post([FromBody] TimeslotReservationDTO reservation) { await _firebaseDataService.MakeReservation(reservation); }