Retrieve Collection

To load records, simply pass the ID, or Query of the linking to the record you're looking for (If nothing is passed,all records in table will be retrieved)

Micron returns IEnumerable<T> when retrieving a collection.

If the records does not exist an empty collection will be returned.

Retrieve all customers.

IEnumerable<Customer> customers = micron.GetRecords<Customer>();
foreach (var customer in customers)
{
   Console.WriteLine(customer.CustomerName);
}

Retrieve with multiple Primary Keys

IEnumerable<Customer> customers = micron.GetRecords<Customer>(new int[] { 1,2,3});
 foreach (var customer in customers)
 {
   Console.WriteLine(customer.CustomerName);
 }

Last updated