internal static Preservation ConvertPreservation(this BibDSModel.PreservationJournalingTableValuedResult valuedResult)
 {
     if (valuedResult == null || !valuedResult.Preservation_IdPreservation.HasValue)
     {
         return(null);
     }
     return(new Preservation()
     {
         CloseDate = valuedResult.Preservation_CloseDate,
         EndDate = valuedResult.Preservation_EndDate,
         IdArchive = valuedResult.Preservation_IdArchive.Value,
         IdPreservation = valuedResult.Preservation_IdPreservation.Value,
         IdPreservationUser = valuedResult.Preservation_IdPreservationUser,
         IndexHash = valuedResult.Preservation_IndexHash,
         Label = valuedResult.Preservation_Label,
         LastVerifiedDate = valuedResult.Preservation_LastVerifiedDate,
         Path = valuedResult.Preservation_Path,
         StartDate = valuedResult.Preservation_StartDate,
         PreservationDate = valuedResult.Preservation_PreservationDate,
         PreservationSize = valuedResult.Preservation_PreservationSize,
         IdDocumentCloseFile = valuedResult.Preservation_IdDocumentClose,
         IdDocumentIndexFile = valuedResult.Preservation_IdDocumentIndex,
         IdDocumentIndexFileXML = valuedResult.Preservation_IdDocumentIndexXml,
         IdDocumentIndexFileXSLT = valuedResult.Preservation_IdDocumentIndexXSLT,
         IdDocumentSignedCloseFile = valuedResult.Preservation_IdDocumentCloseSigned,
         IdDocumentSignedIndexFile = valuedResult.Preservation_IdDocumentIndedSigned,
         LastSectionalValue = valuedResult.Preservation_LastSectionalValue,
         IdArchiveBiblosStore = valuedResult.Preservation_IdArchiveBiblosStore,
         LockOnDocumentInsert = valuedResult.Preservation_LockOnDocumentInsert,
     });
 }
        internal static PreservationUser ConvertPreservationUser(this BibDSModel.PreservationJournalingTableValuedResult valuedResult)
        {
            if (valuedResult == null)
            {
                return(null);
            }

            return(new PreservationUser()
            {
                IdPreservationUser = valuedResult.PreservationUser_IdPreservationUser,
                Address = valuedResult.PreservationUser_Address,
                DomainUser = valuedResult.PreservationUser_DomainUser,
                EMail = valuedResult.PreservationUser_Email,
                Enabled = valuedResult.PreservationUser_Enable,
                FiscalId = valuedResult.PreservationUser_FiscalId,
                Name = valuedResult.PreservationUser_Name,
                Surname = valuedResult.PreservationUser_Surname,
            });
        }
        internal static PreservationJournaling Convert(this BibDSModel.PreservationJournalingTableValuedResult valuedResult)
        {
            if (valuedResult == null)
            {
                return(null);
            }

            return(new PreservationJournaling()
            {
                DateActivity = valuedResult.DateActivity,
                DateCreated = valuedResult.DateCreated,
                DomainUser = valuedResult.DomainUser,
                User = valuedResult.ConvertPreservationUser(),
                IdPreservation = valuedResult.IdPreservation,
                IdPreservationJournaling = valuedResult.IdPreservationJournaling,
                IdPreservationJournalingActivity = valuedResult.IdPreservationJournalingActivity,
                Preservation = valuedResult.ConvertPreservation(),
                PreservationJournalingActivity = valuedResult.ConvertPreservationJournalingActivity(),
                Notes = valuedResult.Notes,
            });
        }
        internal static PreservationJournalingActivity ConvertPreservationJournalingActivity(this BibDSModel.PreservationJournalingTableValuedResult valuedResult)
        {
            if (valuedResult == null)
            {
                return(null);
            }

            return(new PreservationJournalingActivity()
            {
                Description = valuedResult.PreservationJournalingActivity_Description,
                IdPreservationJournalingActivity = valuedResult.PreservationJournalingActivity_IdPreservationJournalingActivity,
                IsUserActivity = valuedResult.PreservationJournalingActivity_IsUserActivity.GetValueOrDefault(false),
                KeyCode = valuedResult.PreservationJournalingActivity_KeyCode,
            });
        }