Ninja Database Pro
NinjaDbPro Class Methods


KellermanSoftware.NinjaDatabasePro Namespace : NinjaDbPro Class

For a list of all members of this type, see NinjaDbPro members.

Public Methods
 NameDescription
Public MethodOverloaded. Add a custom composite index. See the SterlingCompositeIndex in the example directory for an example implementation.  
Public Method Add a full text index  
Public MethodOverloaded. Add a custom index for a single property value. See the SterlingSingleIndex in the example directory for an example implementation.  
Public MethodMake a backup of all database files into a backup directory  
Public Method Begin a bulk operation in a transaction.  
Public MethodStart a transaction to wrap a set of actions. Do a CommitTransaction to permanantly save the actions. Do a RollbackTranaction to undo all the actions in the transaction. If the Phone or PC loses power during a transaction it will automatically be rolled back on OpenDatabase.  
Public Method Clear All Lazy Loaded Values For All Indexes  
Public MethodClose the database  
Public Method Commit a bulk operation in a transaction.  
Public MethodCommit a transaction for a set of actions. Do a BeginTransaction to start the transaction. Do a RollbackTranaction to undo all the actions in the transaction. If the Phone or PC loses power during a transaction it will automatically be rolled back on OpenDatabase.  
Public MethodOverloaded.  Query all index records for the specified composite property index  
Public MethodOverloaded.  Query all index records for the specified single property index  
Public MethodCreate a linq query based on the object type. This performs a table scan returning only items that match the query. Loading by the primary key is fastest, followed by CreateIndexQuery.  
Public MethodOverloaded. Delete a specific object from the database The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown. Example primary key: CustomerId  
Public MethodDelete a backup set  
Public MethodDelete the entire database. This action cannot be undone.  
Public Method Close the streams and release all resources  
Public MethodReturns true if the database exists that was specified in the constructor  
Public MethodExport the current database schema. The definition is the C# class.  
Public MethodExport all records of a table to an XML string  
Public Method Flush buffered data from the index stream and the data stream (this is done automatically on close and commit transaction)  
Public Method Get an index by name  
Public Method Get the next primary key that will be inserted for a type  
Public MethodImport records from an xml string to a table  
Public MethodOverloaded.  Returns true if the index exists for the passed in type and index name  
Public MethodOverloaded. Load an object from the database. The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown. Example primary key: CustomerId If there is nothing found, null is returned.  
Public MethodLoad the entire list of an object type from the database ordered by the primary key Children and parents are not loaded. To load children and parents do a LoadAllWithChildren If there is nothing found, an empty list is returned.  
Public Method Load All Items sorted by the specified index. Only records that match the index value will be loaded.  
Public Method Load a list with all children populated  
Public Method Load a page of items ordered by the primary key  
Public Method Load a page of items, sorted by the specified index. Only records that match the index value will be loaded.  
Public Method Load a page of objects with all children populated, ordered by the primary key  
Public Method Load only the properties and fields specified. The format is the ClassName.PropertyName Performance is not increased, the properties are simply not populated to be used for synchronization scenarios.  
Public MethodLoad the Schema from the database  
Public MethodOpen the database before performing any operation. If the database does not exist it will automatically be created.  
Public MethodReclaim the space from previously deleted and updated items  
Public Method Normally, unused space is aggresively recovered when items are deleted or items are updated and do not fit into the same space. This method is already called internally both inside and outside of transactions. However, when using the BeginBulkOperation and CommitBulkOperation are used, unused space is not calculated. Call this method after a series of bulk operations.  
Public Method Reindex the passed in type.  
Public MethodRemove an index for the property of a type  
Public MethodRestore from a backup set to the current database  
Public Method Undo a bulk operation in progress.  
Public MethodUndo all actions in a transaction. Do a BeginTransaction to start the transaction. Do a CommitTransaction to permanantly save the actions. If the Phone or PC loses power during a transaction it will automatically be rolled back on OpenDatabase.  
Public MethodCount all objects of a specific type  
Public MethodOverloaded. The entire object graph will be saved to the database in an implicit transaction. If there is a problem saving any object, the implicit transation will be automatically rolled back. To save child or parents seperately, define relationships as atributes. The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown. Example primary keys: Id or CustomerId If the primary is zero, the object will be inserted and set when it is saved. If the primary key is greater than zero the object will be updated. CreateDate, if defined will be filled in with the DateTime.Now during an insert UpdateDate, if defined will be filled in with the DateTime.Now during an update.  
Public Method Save only the specified fields or properties. The convention is ClassName.PropertyName There is no performance benefit. The purpose is to be used in synchronization scenarios.  
Public Method Normally the schema file is automatically updated when a new type is added or removed. Use this method to immediately overwrite the schema file when adding or changing the encryption password.  
Public Method Search a full text index by all keywords  
Public Method Search a full text index by any keywords  
Public Method Search a full text index by a regular expression  
Public Method Search a full text index by a phrase  
Public MethodDelete all objects of a specific type  
Top
See Also

Reference

NinjaDbPro Class
KellermanSoftware.NinjaDatabasePro Namespace