Exemplo n.º 1
0
            public WriteSettingsScope(
                WriteDbSettings parentSettings,
                TimeSpan?commandTimeout,
                bool?checkUserRights,
                bool?enableCache,
                bool?withNoLock,
                bool?allowLoadingBinaryData,
                bool?showEntitiesFromOtherMandators,
                bool?returnPreviouslyLoadedEntity_Obsolete)
            {
                parentSettingsDataSet = new WriteDbSettingsDataSet(
                    commandTimeout: parentSettings.CommandTimeout,
                    checkUserRights: parentSettings.CheckUserRights,
                    enableCache: parentSettings.EnableCache,
                    withNoLock: parentSettings.WithNoLock,
                    allowLoadingBinaryData: parentSettings.AllowLoadingBinaryData,
                    showEntitiesFromOtherMandators: parentSettings.ShowEntitiesFromOtherMandators,
                    returnPreviouslyLoadedEntity_Obsolete: parentSettings.ReturnPreviouslyLoadedEntity_Obsolete);

                parentSettings.CheckUserRights                       = checkUserRights ?? parentSettings.CheckUserRights;
                parentSettings.CommandTimeout                        = commandTimeout ?? parentSettings.CommandTimeout;
                parentSettings.EnableCache                           = enableCache ?? parentSettings.EnableCache;
                parentSettings.WithNoLock                            = withNoLock ?? parentSettings.WithNoLock;
                parentSettings.AllowLoadingBinaryData                = allowLoadingBinaryData ?? parentSettings.AllowLoadingBinaryData;
                parentSettings.ShowEntitiesFromOtherMandators        = showEntitiesFromOtherMandators ?? parentSettings.ShowEntitiesFromOtherMandators;
                parentSettings.ReturnPreviouslyLoadedEntity_Obsolete = returnPreviouslyLoadedEntity_Obsolete ?? parentSettings.ReturnPreviouslyLoadedEntity_Obsolete;

                scopeSettings = parentSettings;
            }
Exemplo n.º 2
0
 public static IDisposable BeginScope(
     this WriteDbSettings settings,
     TimeSpan?commandTimeout                    = null,
     bool?checkUserRights                       = null,
     bool?enableCache                           = null,
     bool?withNoLock                            = null,
     bool?allowLoadingBinaryData                = null,
     bool?showEntitiesFromOtherMandators        = null,
     bool?returnPreviouslyLoadedEntity_Obsolete = null)
 {
     return(new WriteSettingsScope(
                parentSettings: settings,
                commandTimeout: commandTimeout,
                checkUserRights: checkUserRights,
                enableCache: enableCache,
                withNoLock: withNoLock,
                allowLoadingBinaryData: allowLoadingBinaryData,
                showEntitiesFromOtherMandators: showEntitiesFromOtherMandators,
                returnPreviouslyLoadedEntity_Obsolete: returnPreviouslyLoadedEntity_Obsolete));
 }