public static table_mail GetDetails(int id) { table_mail foundItem=new XXXXX; dbMailEntityDataModel contesto = new dbMailEntityDataModel(); var dc = from c in contesto.table_mail where c.ID == id select c; if(dc.Count == 1) foundItem=dc[0]; return foundItem; }
Io farei così, prova a vedere se ti da errore.table_mail è un entità giusto? Non è un modello creato da te, giusto? public static table_mail GetDetails(int id) { table_mail foundItem=new XXXXX; dbMailEntityDataModel contesto = new dbMailEntityDataModel(); var dc = from c in contesto.table_mail where c.ID == id select c; if(dc.Count == 1) foundItem=dc[0]; return foundItem; }
Torna al forum | Feed RSS