DataContext
Formn is similar to LINQ to SQL in that most database operations are done via a DataContext instance. There is one DataContext implementation per supported database flavor. For example, for a MySQL database you would use a MySQLDataContext.
In the coming chapters we’ll cover instantiating and using this class, but for now note that the following DataContext methods are commonly used.
- connect: Connect to a database.
- insert: Insert a model into the database.
- from: Select from the database, batch update, or batch delete records from the database.
- update: Update a model.
- delete: Delete a model.
- beginTransaction: Start a database transaction.
Each will be explored in greater detail in the next sections.