Public Function LoadPartial(Of T As {Class, New})( _ ByVal primaryKey As Long, _ ByVal propertiesOrFieldsToLoad As List(Of String) _ ) As T
Dim instance As NinjaDbPro Dim primaryKey As Long Dim propertiesOrFieldsToLoad As List(Of String) Dim value As T value = instance.LoadPartial(Of T)(primaryKey, propertiesOrFieldsToLoad)
public T LoadPartial<T>( long primaryKey, List<string> propertiesOrFieldsToLoad ) where T: class, new()
public: T^ LoadPartialgeneric<typename T> ( int64 primaryKey, List<String^>^ propertiesOrFieldsToLoad ) where T: ref class, gcnew()
NinjaDbPro db = new NinjaDbPro("MyDatabaseDirectory", "MyDatabaseName"); //Licensed Mode //db.UserName = "John Smith 101224"; //db.LicenseKey = "aousdf832jasf=="; //Set before OpenDatabase. Default storage is IsolatedStorageDatabase. Other options are: //db.Storage = new MemoryDatabase(); //In memory database //db.Storage = new FileDatabase(); db.OpenDatabase(); //Save a person Person person = new Person(); person.Name = "Greg"; person.DateCreated = DateTime.Today; db.Save(person); //Load a Partial List<string> fieldsOrPropertiesToLoad = new List<string>(); fieldsOrPropertiesToLoad.Add("Person.DateCreated"); Person personCopy = db.LoadPartial<Person>(person.PersonId, fieldsOrPropertiesToLoad);
Dim db As New NinjaDbPro("MyDatabaseDirectory", "MyDatabaseName") 'Licensed Mode 'db.UserName = "John Smith 101224"; 'db.LicenseKey = "aousdf832jasf=="; 'Set before OpenDatabase. Default storage is IsolatedStorageDatabase. Other options are: 'db.Storage = new MemoryDatabase(); //In memory database 'db.Storage = new FileDatabase(); db.OpenDatabase() 'Save a person Dim person As New Person() person.Name = "Greg" person.DateCreated = Date.Today db.Save(person) 'Load a Partial Dim fieldsOrPropertiesToLoad As New List(Of String)() fieldsOrPropertiesToLoad.Add("Person.DateCreated") Dim personCopy As Person = db.LoadPartial(Of Person)(person.PersonId, fieldsOrPropertiesToLoad)
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2