public static List <ICustomer> CustomersWhoBoughtProduct(int productId) { List <ICustomer> result = new List <ICustomer>(); using (MyModelContainer ctx = new MyModelContainer()) { var entityList = ctx.CustomersWhoBoughtProduct(productId).ToList(); foreach (var entity in entityList) { result.Add(new CustomersWhoBoughtProduct_Result_Adapter(entity)); } } return(result); }
public static List <ICustomer> CustomersByCountry(string country) { List <ICustomer> result = new List <ICustomer>(); using (MyModelContainer ctx = new MyModelContainer()) { var entityList = ctx.CustomersByCountry(country).ToList(); foreach (var entity in entityList) { result.Add(new CustomersByCountry_Result_Adapter(entity)); } } return(result); }