Castle.ActiveRecord.ActiveRecordBase.Delete C# (CSharp) Method

Delete() protected static method

Deletes the instance from the database.
protected static Delete ( object instance ) : void
instance object The ActiveRecord instance to be deleted
return void
		protected internal static void Delete(object instance)
		{
			InternalDelete(instance, false);
		}

Same methods

ActiveRecordBase::Delete ( ) : void

Usage Example

Ejemplo n.º 1
0
        protected internal static int DeleteAll(Type targetType, IEnumerable pkValues)
        {
            if (pkValues == null)
            {
                return(0);
            }

            int c = 0;

            foreach (int pk in pkValues)
            {
                Object obj = FindByPrimaryKey(targetType, pk, false);
                if (obj != null)
                {
                    ActiveRecordBase arBase = obj as ActiveRecordBase;
                    if (arBase != null)
                    {
                        arBase.Delete();                         // in order to allow override of the virtual "Delete()" method
                    }
                    else
                    {
                        ActiveRecordBase.Delete(obj);
                    }
                    c++;
                }
            }
            return(c);
        }
All Usage Examples Of Castle.ActiveRecord.ActiveRecordBase::Delete