Example #1
0
        /// <summary>
        /// Deletes the Container from the current Authority
        /// </summary>
        public void Delete()
        {
            SitkaClient.Scope scope = connection.Scope;
            scope.ContainerId = this.Id;

            connection.Delete(scope);
        }
Example #2
0
        /// <summary>
        /// Inserts a new entity. If the insert fails, an exception will be thrown.
        /// </summary>
        /// <param name="entity">Entity to insert</param>
        public void InsertEntity(Entity entity)
        {
            // convert to Sitka format
            SitkaClient.Entity sitkaEntity = new SitkaClient.Entity();
            entity.CopyTo(sitkaEntity);

            SitkaClient.Scope scope = connection.Scope;
            scope.ContainerId = this.Id;

            connection.Create(scope, sitkaEntity);
        }
        public Container GetContainerById(string id)
        {
            SitkaClient.Scope newScope = new SitkaClient.Scope();
            newScope.AuthorityId = _scope.AuthorityId;
            newScope.ContainerId = id;

            SitkaClient.Entity e = service.Get(newScope);

            Container c = Container.Create(this, e);

            return(c);
        }
Example #4
0
        public Container GetContainerById(string id)
        {
            SitkaClient.Scope newScope = new SitkaClient.Scope();
            newScope.AuthorityId = _scope.AuthorityId;
            newScope.ContainerId = id;

            SitkaClient.Entity e = service.Get(newScope);

            Container c = Container.Create(this, e);

            return c;
        }
Example #5
0
        public Entity[] GetEntitiesByQuery(string query)
        {
            // Setup the scope
            SitkaClient.Scope scope = connection.Scope;
            scope.ContainerId = this.Id;

            SitkaClient.Entity[] sitkaEntities = connection.Query(scope, query);

            Entity[] entities = new Entity[sitkaEntities.Length];
            for (int i = 0; i < entities.Length; i++)
            {
                Entity e = new Entity();
                e.CopyFrom(sitkaEntities[i]);

                entities[i] = e;
            }

            return(entities);
        }
Example #6
0
 /// <remarks/>
 public void QueryAsync(Scope scope, string query1) {
     this.QueryAsync(scope, query1, null);
 }
 internal void Delete(SitkaClient.Scope scope)
 {
     service.Delete(scope);
 }
 internal SitkaClient.Entity[] Query(SitkaClient.Scope scope, string query)
 {
     return(service.Query(scope, query));
 }
 internal SitkaClient.Scope Create(SitkaClient.Scope scope, SitkaClient.Entity entity)
 {
     return(service.Create(scope, entity));
 }
Example #10
0
 /// <remarks/>
 public void GetAsync(Scope scope) {
     this.GetAsync(scope, null);
 }
Example #11
0
 public Entity Get(Scope scope) {
     object[] results = this.Invoke("Get", new object[] {
                 scope});
     return ((Entity)(results[0]));
 }
Example #12
0
 /// <remarks/>
 public void QueryAsync(Scope scope, string query1, object userState) {
     if ((this.QueryOperationCompleted == null)) {
         this.QueryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnQueryOperationCompleted);
     }
     this.InvokeAsync("Query", new object[] {
                 scope,
                 query1}, this.QueryOperationCompleted, userState);
 }
Example #13
0
 public Scope Create(Scope scope, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] Entity entity) {
     object[] results = this.Invoke("Create", new object[] {
                 scope,
                 entity});
     return ((Scope)(results[0]));
 }
Example #14
0
 public Entity[] Query(Scope scope, [System.Xml.Serialization.XmlElementAttribute("query", IsNullable=true)] string query1) {
     object[] results = this.Invoke("Query", new object[] {
                 scope,
                 query1});
     return ((Entity[])(results[0]));
 }
Example #15
0
 /// <remarks/>
 public void CreateAsync(Scope scope, Entity entity) {
     this.CreateAsync(scope, entity, null);
 }
Example #16
0
 /// <remarks/>
 public void DeleteAsync(Scope scope, object userState) {
     if ((this.DeleteOperationCompleted == null)) {
         this.DeleteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOperationCompleted);
     }
     this.InvokeAsync("Delete", new object[] {
                 scope}, this.DeleteOperationCompleted, userState);
 }
Example #17
0
 /// <remarks/>
 public void DeleteAsync(Scope scope) {
     this.DeleteAsync(scope, null);
 }
Example #18
0
 public void Delete(Scope scope) {
     this.Invoke("Delete", new object[] {
                 scope});
 }
Example #19
0
 /// <remarks/>
 public void UpdateAsync(Scope scope, Entity entity, object userState) {
     if ((this.UpdateOperationCompleted == null)) {
         this.UpdateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOperationCompleted);
     }
     this.InvokeAsync("Update", new object[] {
                 scope,
                 entity}, this.UpdateOperationCompleted, userState);
 }
Example #20
0
 /// <remarks/>
 public void UpdateAsync(Scope scope, Entity entity) {
     this.UpdateAsync(scope, entity, null);
 }