J'ai ce code:Impossible de convertir implicitement le type ... à ... problème
public static IEnumerable<dcCustomer> searchCustomer(string Companyname)
{
TestdbDataContext db = new TestdbDataContext();
IEnumerable<dcCustomer> myCustomerList = (from Customer res
in db.Customers
where res.CompanyName == Companyname
select res);
return myCustomerList;
}
Et tout ce que j'essaie i l'erreur persiste de conversion.
Error 1 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<ConnectionWeb.Customer>' to 'System.Collections.Generic.IEnumerable<ConnectionWeb.DAL.dcCustomer>'. An explicit conversion exists (are you missing a cast?) \\srv01\home$\Z****\Visual Studio 2008\Projects\ConnectionWeb\ConnectionWeb\DAL\dcCustomer.cs 63 20 ConnectionWeb
Je veux essayer obtenir myCustomerList de conserver les valeurs dans un recenseur et le retourner.
Merci pour votre réponse! – Younes