public static dtoRS.ResourceSchedule ToDto(this objRS.ResourceSchedule source)
 {
     return(new dtoRS.ResourceSchedule()
     {
         CreatedBy = source.CreatedBy,
         CreatedDate = source.CreatedDate,
         Id = source.Id,
         IsDeleted = source.IsDeleted,
         ReservationEndDateTime = source.ReservationEndDateTime,
         ReservationNotes = source.ReservationNotes,
         ReservationStartDateTime = source.ReservationStartDateTime,
         ReservedByUserId = source.ReservedByUserId,
         ReservedForUser = source.ReservedForUser,
         ReservedOnDateTime = source.ReservedOnDateTime,
         ResourceId = source.ResourceId,
         UpdatedBy = source.UpdatedBy,
         UpdatedDate = source.UpdatedDate,
     });
 }
        public async Task <int> WriteResourceSchedule(objModel.ResourceSchedule resourceSchedule)
        {
            //write this to the PendingResourceSchedule table
            var pending = new dataModel.PendingResourceSchedule()
            {
                CreatedBy                = resourceSchedule.CreatedBy,
                CreatedDate              = resourceSchedule.CreatedDate,
                Id                       = resourceSchedule.Id,
                IsDeleted                = resourceSchedule.IsDeleted,
                ReservationDate          = resourceSchedule.ReservationDate,
                ReservationEndDateTime   = resourceSchedule.ReservationEndDateTime,
                ReservationNotes         = resourceSchedule.ReservationNotes,
                ReservationStartDateTime = resourceSchedule.ReservationStartDateTime,
                ReservedByUserId         = resourceSchedule.ReservedByUserId,
                ReservedForUser          = resourceSchedule.ReservedForUser,
                ReservedOnDateTime       = resourceSchedule.ReservedOnDateTime,
                ResourceId               = resourceSchedule.ResourceId,
                UpdatedBy                = resourceSchedule.UpdatedBy,
                UpdatedDate              = resourceSchedule.UpdatedDate
            };

            return(await _db.GetAsyncConnection().InsertOrReplaceAsync(pending));
        }