Ephraim Moss - 511 - Dec 13, 2013

Hi

We currently have a domain model that looks something like this:

class Customer
{
int id {get;set}
string Name {get;set}
List<Contact> Contacts {get;set}
}

class Contact
{
int id {get;set}
string FullName {get;set}
List<PhoneNumber> {get;set}
}

class PhoneNumber
{
int id {get;set}
PhoneType Type {get;set}
string Number {get;set}
}

Customer, Contact & PhoneNumbers are separate entities in our DB.

Any Suggestions as to how to populate a full customer with all its linked contacts and the contacts phone numbers in the most efficient way using ORMLite and/or Dapper, with consideration of calls to the db and cpu cycles to map to the POCOs?

Ephraim Moss:

Probably the wrong place for this. will ask on StackOverflow.

You can try out the new reference support for this: https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/tests/ServiceStack.OrmLite.Tests/LoadReferencesTests.cs

Ephraim Moss:

Great thanks will give this a bash!