RDFSharp.Store.RDFSQLServerStore.RemoveQuadruplesByObject C# (CSharp) Метод

RemoveQuadruplesByObject() публичный Метод

Removes the quadruples with the given resource as object
public RemoveQuadruplesByObject ( RDFResource objectResource ) : RDFStore
objectResource RDFSharp.Model.RDFResource
Результат RDFStore
        public override RDFStore RemoveQuadruplesByObject(RDFResource objectResource)
        {
            if (objectResource   != null) {

                //Create command
                var command       = new SqlCommand("DELETE FROM [dbo].[Quadruples] WHERE [ObjectID] = @OBJID AND [TripleFlavor] = @TFV", this.Connection);
                command.Parameters.Add(new SqlParameter("OBJID", SqlDbType.BigInt));
                command.Parameters.Add(new SqlParameter("TFV",   SqlDbType.Int));

                //Valorize parameters
                command.Parameters["OBJID"].Value = objectResource.PatternMemberID;
                command.Parameters["TFV"].Value   = RDFModelEnums.RDFTripleFlavors.SPO;

                try {

                    //Open connection
                    this.Connection.Open();

                    //Prepare command
                    command.Prepare();

                    //Open transaction
                    command.Transaction = this.Connection.BeginTransaction();

                    //Execute command
                    command.ExecuteNonQuery();

                    //Close transaction
                    command.Transaction.Commit();

                    //Close connection
                    this.Connection.Close();

                }
                catch (Exception ex) {

                    //Rollback transaction
                    command.Transaction.Rollback();

                    //Close connection
                    this.Connection.Close();

                    //Propagate exception
                    throw new RDFStoreException("Cannot delete data from SQL Server store because: " + ex.Message, ex);

                }
            }
            return this;
        }