src/EntityFramework/Core/Metadata/Edm/MetadataArtifactLoaderCompositeFile.cs
// <summary>
// Load all the collections at once so we have a "fairly" matched in time set of files
// otherwise we may end up loading the csdl files, and then not loading the ssdl, and msl
// files for sometime later.
// </summary>
Load all the collections at once so we have a "fairly" matched in time set of files
otherwise we may end up loading the csdl files, and then not loading the ssdl, and msl
files for sometime later.
Load all the collections at once so we have a " fairly " matched in time set of files otherwise we may end up loading the csdl files and then not loading the ssdl and msl files for sometime later .
[ResourceExposure(ResourceScope.None)]
        [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
        private void LoadCollections()
        {
            if (_csdlChildren == null)
            {
                var csdlChildren = new ReadOnlyCollection<MetadataArtifactLoaderFile>(GetArtifactsInDirectory(_path, XmlConstants.CSpaceSchemaExtension, _uriRegistry));
                Interlocked.CompareExchange(ref _csdlChildren, csdlChildren, null);
            }
            if (_ssdlChildren == null)
            {
                var ssdlChildren = new ReadOnlyCollection<MetadataArtifactLoaderFile>(GetArtifactsInDirectory(_path, XmlConstants.SSpaceSchemaExtension, _uriRegistry));
                Interlocked.CompareExchange(ref _ssdlChildren, ssdlChildren, null);
            }
            if (_mslChildren == null)
            {
                var mslChildren = new ReadOnlyCollection<MetadataArtifactLoaderFile>(GetArtifactsInDirectory(_path, XmlConstants.CSSpaceSchemaExtension, _uriRegistry));
                Interlocked.CompareExchange(ref _mslChildren, mslChildren, null);
            }
        }
[ ResourceExposure ( ResourceScope . None ) ] [ ResourceConsumption ( ResourceScope . Machine , ResourceScope . Machine ) ] private void LoadCollections ( ) { if ( _csdlChildren == null ) { var csdlChildren = new ReadOnlyCollection < MetadataArtifactLoaderFile > ( GetArtifactsInDirectory ( _path , XmlConstants . CSpaceSchemaExtension , _uriRegistry ) ) ; Interlocked . CompareExchange ( ref _csdlChildren , csdlChildren , null ) ; } if ( _ssdlChildren == null ) { var ssdlChildren = new ReadOnlyCollection < MetadataArtifactLoaderFile > ( GetArtifactsInDirectory ( _path , XmlConstants . SSpaceSchemaExtension , _uriRegistry ) ) ; Interlocked . CompareExchange ( ref _ssdlChildren , ssdlChildren , null ) ; } if ( _mslChildren == null ) { var mslChildren = new ReadOnlyCollection < MetadataArtifactLoaderFile > ( GetArtifactsInDirectory ( _path , XmlConstants . CSSpaceSchemaExtension , _uriRegistry ) ) ; Interlocked . CompareExchange ( ref _mslChildren , mslChildren , null ) ; } }
Load all the collections at once so we have a "fairly" matched in time set of files
otherwise we may end up loading the csdl files, and then not loading the ssdl, and msl
files for sometime later.
Load all the collections at once so we have a " fairly " matched in time set of files otherwise we may end up loading the csdl files and then not loading the ssdl and msl files for sometime later .
//For GetArtifactsInDirectory method call. We pick the paths from class variable.  //so this method does not expose any resource.