示例#1
0
        private Session(ODataClientSettings settings)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter  = () => _adapterFactory.ParseMetadata(this.MetadataCache.MetadataAsString);

            this.Settings      = settings;
            this.MetadataCache = MetadataCache.Instances.GetOrAdd(this.Settings.UrlBase, new MetadataCache());
            this.Pluralizer    = new SimplePluralizer();
        }
        private Session(Uri baseUri, string metadataString)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter = () => _adapterFactory.ParseMetadata(metadataString);

            this.Settings = new ODataClientSettings();
            this.Settings.BaseUri = baseUri;
            this.MetadataCache = MetadataCache.Instances.GetOrAdd(baseUri.AbsoluteUri, new MetadataCache());
            this.MetadataCache.SetMetadataDocument(metadataString);
            this.Pluralizer = new SimplePluralizer();
        }
示例#3
0
        private Session(string urlBase, string metadataString)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter  = () => _adapterFactory.ParseMetadata(metadataString);

            this.Settings         = new ODataClientSettings();
            this.Settings.UrlBase = urlBase;
            this.MetadataCache    = MetadataCache.Instances.GetOrAdd(urlBase, new MetadataCache());
            this.MetadataCache.SetMetadataString(metadataString);
            this.Pluralizer = new SimplePluralizer();
        }
示例#4
0
        private Session(Uri baseUri, string metadataString)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter  = () => _adapterFactory.ParseMetadata(metadataString);

            this.Settings         = new ODataClientSettings();
            this.Settings.BaseUri = baseUri;
            this.MetadataCache    = MetadataCache.Instances.GetOrAdd(baseUri.AbsoluteUri, new MetadataCache());
            this.MetadataCache.SetMetadataDocument(metadataString);
            this.Pluralizer = new SimplePluralizer();
        }
        private Session(ODataClientSettings settings)
        {
            if (settings.BaseUri == null || string.IsNullOrEmpty(settings.BaseUri.AbsoluteUri))
                throw new InvalidOperationException("Unable to create client session with no URI specified");

            _adapterFactory = new AdapterFactory(this);
            _createAdapter = () => _adapterFactory.ParseMetadata(this.MetadataCache.MetadataDocument);

            this.Settings = settings;
            this.MetadataCache = MetadataCache.Instances.GetOrAdd(this.Settings.BaseUri.AbsoluteUri, new MetadataCache());
            this.Pluralizer = new SimplePluralizer();
        }
        private Session(Uri baseUri, ICredentials credentials, ODataPayloadFormat payloadFormat)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter = () => _adapterFactory.ParseMetadata(this.MetadataCache.MetadataDocument);

            this.Settings = new ODataClientSettings();
            this.Settings.BaseUri = baseUri;
            this.Settings.Credentials = credentials;
            this.Settings.PayloadFormat = payloadFormat;
            this.MetadataCache = MetadataCache.Instances.GetOrAdd(baseUri.AbsoluteUri, new MetadataCache());
            this.Pluralizer = new SimplePluralizer();
        }
示例#7
0
        private Session(string urlBase, ICredentials credentials, ODataPayloadFormat payloadFormat)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter  = () => _adapterFactory.ParseMetadata(this.MetadataCache.MetadataAsString);

            this.Settings               = new ODataClientSettings();
            this.Settings.UrlBase       = urlBase;
            this.Settings.Credentials   = credentials;
            this.Settings.PayloadFormat = payloadFormat;
            this.MetadataCache          = MetadataCache.Instances.GetOrAdd(urlBase, new MetadataCache());
            this.Pluralizer             = new SimplePluralizer();
        }
示例#8
0
        private Session(Uri baseUri, ICredentials credentials, ODataPayloadFormat payloadFormat)
        {
            _adapterFactory = new AdapterFactory(this);
            _createAdapter  = () => _adapterFactory.ParseMetadata(this.MetadataCache.MetadataDocument);

            this.Settings               = new ODataClientSettings();
            this.Settings.BaseUri       = baseUri;
            this.Settings.Credentials   = credentials;
            this.Settings.PayloadFormat = payloadFormat;
            this.MetadataCache          = MetadataCache.Instances.GetOrAdd(baseUri.AbsoluteUri, new MetadataCache());
            this.Pluralizer             = new SimplePluralizer();
        }
示例#9
0
        private Session(ODataClientSettings settings)
        {
            if (settings.BaseUri == null || string.IsNullOrEmpty(settings.BaseUri.AbsoluteUri))
            {
                throw new InvalidOperationException("Unable to create client session with no URI specified");
            }

            _adapterFactory = new AdapterFactory(this);
            _createAdapter  = () => _adapterFactory.ParseMetadata(this.MetadataCache.MetadataDocument);

            this.Settings      = settings;
            this.MetadataCache = MetadataCache.Instances.GetOrAdd(this.Settings.BaseUri.AbsoluteUri, new MetadataCache());
            this.Pluralizer    = new SimplePluralizer();
        }