TableHierarchySample.Firm.DeleteAll C# (CSharp) Method

DeleteAll() public static method

public static DeleteAll ( ) : void
return void
		public new static void DeleteAll()
		{
			ActiveRecordBase.DeleteAll( typeof(Firm) );
		}

Usage Example

示例#1
0
        public static void Main()
        {
            ActiveRecordStarter.Initialize(
                new XmlConfigurationSource("../appconfig.xml"),
                typeof(Company), typeof(Client), typeof(Firm), typeof(Person));

            // If you want to let AR to create the schema

            ActiveRecordStarter.CreateSchema();

            // Common usage

            Client.DeleteAll();
            Firm.DeleteAll();
            Company.DeleteAll();

            Company company = new Company("Keldor");

            company.Save();

            Firm firm = new Firm("Johnson & Norman");

            firm.Save();

            Client client = new Client("hammett", firm);

            client.Save();

            // Dropping the schema

            ActiveRecordStarter.DropSchema();
        }