Create a record

CRUD

CRUD stands for Create, Update, Retrieve and Delete. CRUD operations are the core of many database applications.

To create a new record (of type 'customer') use:

 //create connection
var micron = new MicronDbContext();
            
//create  model object
Customer customer = new Customer();

//set the properties
customer.CustomerName = "John Doe";
customer.ContactName = "Doe";
customer.Country = "Kenya";
customer.City = "Nairobi";

//save the record
micron.Save(customer);

To access data models, use namespace. using Data.Models;

Last updated