src/Shared/EntityFramework/Core/Mapping/Update/Internal/ViewLoader.cs
// <summary>
// Initializes all information relevant to the entity set.
// </summary>
// <param name="entitySetBase"> Association set or entity set to load. </param>
// <param name="evaluate"> Function to evaluate to produce a result. </param>
Initializes all information relevant to the entity set.
Initializes all information relevant to the entity set .
private TResult SyncInitializeEntitySet<TArg, TResult>(
            EntitySetBase entitySetBase, MetadataWorkspace workspace, Func<TArg, TResult> evaluate, TArg arg)
        {
            m_readerWriterLock.EnterReadLock();
            try
            {
                if (m_affectedTables.ContainsKey(entitySetBase))
                {
                    return evaluate(arg);
                }
            }
            finally
            {
                m_readerWriterLock.ExitReadLock();
            }
            m_readerWriterLock.EnterWriteLock();
            try
            {
                if (m_affectedTables.ContainsKey(entitySetBase))
                {
                    return evaluate(arg);
                }
                InitializeEntitySet(entitySetBase, workspace);
                return evaluate(arg);
            }
            finally
            {
                m_readerWriterLock.ExitWriteLock();
            }
        }
private TResult SyncInitializeEntitySet < TArg , TResult > ( EntitySetBase entitySetBase , MetadataWorkspace workspace , Func < TArg , TResult > evaluate , TArg arg ) { m_readerWriterLock . EnterReadLock ( ) ; try { if ( m_affectedTables . ContainsKey ( entitySetBase ) ) { return evaluate ( arg ) ; } } finally { m_readerWriterLock . ExitReadLock ( ) ; } m_readerWriterLock . EnterWriteLock ( ) ; try { if ( m_affectedTables . ContainsKey ( entitySetBase ) ) { return evaluate ( arg ) ; } InitializeEntitySet ( entitySetBase , workspace ) ; return evaluate ( arg ) ; } finally { m_readerWriterLock . ExitWriteLock ( ) ; } }
Initializes all information relevant to the entity set.
Initializes all information relevant to the entity set .
// check if we've already done the work for this entity set // acquire a write lock // see if we've since done the work for this entity set
entitySetBase
EntitySetBase
Association set or entity set to load.
Association set or entity set to load .
workspace
MetadataWorkspace
evaluate
Func<TArg, TResult>
Function to evaluate to produce a result.
Function to evaluate to produce a result .
arg
TArg