Ejemplo n.º 1
0
 internal DatabaseCore(
     CosmosClientContext clientContext,
     string databaseId)
 {
     this.Id            = databaseId;
     this.ClientContext = clientContext;
     this.LinkUri       = clientContext.CreateLink(
         parentLink: null,
         uriPathSegment: Paths.DatabasesPathSegment,
         id: databaseId);
 }
 internal CosmosStoredProcedureCore(
     CosmosClientContext clientContext,
     CosmosContainerCore container,
     string storedProcedureId)
 {
     this.clientContext = clientContext;
     this.Id            = storedProcedureId;
     this.LinkUri       = clientContext.CreateLink(
         parentLink: container.LinkUri.OriginalString,
         uriPathSegment: Paths.StoredProceduresPathSegment,
         id: storedProcedureId);
 }
Ejemplo n.º 3
0
 internal PermissionCore(
     CosmosClientContext clientContext,
     UserCore user,
     string userId)
 {
     this.Id            = userId;
     this.ClientContext = clientContext;
     this.linkUri       = clientContext.CreateLink(
         parentLink: user.LinkUri,
         uriPathSegment: Paths.PermissionsPathSegment,
         id: userId);
 }
        internal UserCore(
            CosmosClientContext clientContext,
            DatabaseCore database,
            string userId)
        {
            this.Id            = userId;
            this.ClientContext = clientContext;
            this.LinkUri       = clientContext.CreateLink(
                parentLink: database.LinkUri.OriginalString,
                uriPathSegment: Paths.UsersPathSegment,
                id: userId);

            this.Database = database;
        }
        internal CosmosContainerCore(
            CosmosClientContext clientContext,
            CosmosDatabaseCore database,
            string containerId)
        {
            this.Id            = containerId;
            this.ClientContext = clientContext;
            this.LinkUri       = clientContext.CreateLink(
                parentLink: database.LinkUri.OriginalString,
                uriPathSegment: Paths.CollectionsPathSegment,
                id: containerId);

            this.Database  = database;
            this.conflicts = new CosmosConflictsCore(this.ClientContext, this);
            this.cachedUriSegmentWithoutId = this.GetResourceSegmentUriWithoutId();
            this.queryClient = queryClient ?? new CosmosQueryClientCore(this.ClientContext, this);
        }
        internal CosmosContainerCore(
            CosmosClientContext clientContext,
            CosmosDatabaseCore database,
            string containerId)
        {
            this.Id            = containerId;
            this.ClientContext = clientContext;
            this.LinkUri       = clientContext.CreateLink(
                parentLink: database.LinkUri.OriginalString,
                uriPathSegment: Paths.CollectionsPathSegment,
                id: containerId);

            this.Database             = database;
            this.Items                = new CosmosItemsCore(this.ClientContext, this);
            this.StoredProcedures     = new CosmosStoredProceduresCore(this.ClientContext, this);
            this.Triggers             = new CosmosTriggers(this.ClientContext, this);
            this.UserDefinedFunctions = new CosmosUserDefinedFunctions(this.ClientContext, this);
        }
Ejemplo n.º 7
0
        protected ContainerCore(
            CosmosClientContext clientContext,
            DatabaseInternal database,
            string containerId,
            CosmosQueryClient cosmosQueryClient = null)
        {
            this.Id            = containerId;
            this.ClientContext = clientContext;
            this.LinkUri       = clientContext.CreateLink(
                parentLink: database.LinkUri.OriginalString,
                uriPathSegment: Paths.CollectionsPathSegment,
                id: containerId);

            this.Database  = database;
            this.Conflicts = new ConflictsInlineCore(this.ClientContext, this);
            this.Scripts   = new ScriptsInlineCore(this, this.ClientContext);
            this.cachedUriSegmentWithoutId = this.GetResourceSegmentUriWithoutId();
            this.queryClient       = cosmosQueryClient ?? new CosmosQueryClientCore(this.ClientContext, this);
            this.lazyBatchExecutor = new Lazy <BatchAsyncContainerExecutor>(() => this.ClientContext.GetExecutorForContainer(this));
        }
Ejemplo n.º 8
0
        internal ContainerCore(
            CosmosClientContext clientContext,
            DatabaseCore database,
            string containerId,
            CosmosQueryClient cosmosQueryClient = null)
        {
            this.Id            = containerId;
            this.ClientContext = clientContext;
            this.LinkUri       = clientContext.CreateLink(
                parentLink: database.LinkUri.OriginalString,
                uriPathSegment: Paths.CollectionsPathSegment,
                id: containerId);

            this.Database  = database;
            this.Conflicts = new ConflictsInlineCore(new ConflictsCore(this.ClientContext, this));
            this.Scripts   = new ScriptsInlineCore(new ScriptsCore(this, this.ClientContext));
            this.cachedUriSegmentWithoutId = this.GetResourceSegmentUriWithoutId();
            this.queryClient   = cosmosQueryClient ?? new CosmosQueryClientCore(this.ClientContext, this);
            this.BatchExecutor = this.InitializeBatchExecutorForContainer();
        }