public async Task <IActionResult> AddNote(string id, string note) { var reservation = await _appDbContext .Reservations .FirstOrDefaultAsync(p => p.UserId == GetUserId() && p.ReservationId == id); if (reservation == null) { return(NotFound()); } var notes = new ReservationNote { ReservationNoteId = Guid.NewGuid().ToString(), ReservationId = id, Content = note, DateCreated = DateTime.UtcNow, UserId = GetUserId(), }; await _appDbContext.ReservationNotes .AddAsync(notes); await _appDbContext.SaveChangesAsync(); return(Ok()); }
public ReservationNote Build() { var rn = new ReservationNote { AdditionalNote = _additionalNote ?? string.Empty, Category = _category, EntityId = _id, IncludeOnConfirmation = _includeOnConfirmation, LodgingReservation = _lodgingReservation, SourceNoteSubject = _sourceNoteSubject ?? string.Empty, IsFulfilled = _isFulfilled }; if (_sourceNote != null) { rn.SourceNote = _sourceNote; } return(rn); }