public BookingId Create(TenantId tenantId, CustomerId customerId, TherapyId therapyId, DateTimeOffset proposedTime, TimeSpan duration) { using (var uow = _unitOfWorkFactory.CreateSession()) { // Create booking, add to repo and commit var booking = _bookingFactory.Create(tenantId, customerId, therapyId, proposedTime, duration); uow.GetRepository <IBookingWriteRepository>().Add(booking); uow.Commit(); return(booking.BookingId); } }