|
Demo Version
|
|
Download and try for yourself a fully working demo version, including sample apps and documentation. The only limitation is that the demo version only works inside the debugger.
|
|
Subscribe
|
|
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
|
|
|
Wilson ORMapper Examples
|
|
Persistence Examples
using System; using Wilson.ORMapper;
namespace Wilson.Examples
{
publicsealedclass Global
{
publicstatic ObjectSpace Manager; // See Initialization Example
privatestaticvoid RunExamples() {
// Create Object using ObjectSpace's GetObject method
Contact contact = (Contact) Manager.GetObject(typeof(Contact));
contact.Name = "Wilson, Paul";
contact.Company = "WilsonDotNet.com";
Manager.PersistChanges(contact); // Insert into Database
int id = contact.Id; // Auto Identity assigned by Database
// Retrieve Object by Primary Key using GetObject method
contact = (Contact) Manager.GetObject(typeof(Contact), id);
// Update Object changes using the PersistChanges method
contact.Name = "Paul Wilson";
Manager.PersistChanges(contact); // Update the Database
// Delete Object using MarkForDeletion and PersistChanges
Manager.MarkForDeletion(contact); // Mark for Deletion
Manager.PersistChanges(contact); // Delete from Database
}
}
}
|
|