Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,


I have a stored procedure that does this for example

select prop1, prop2 from table 



In entity framework i have mapped this sp to return a complex type like the following

class sp_result 
{
   public string prop1 { get; set;} 
    public string prop2 { get; set;}
   public string prop3 { get; set;}
}


The problem is that i get an exception when i call the mapped sp in EF:

The data reader is incompatible with the specified 'prop3'. A member of the type, 'prop3', does not have a corresponding column in the data reader with the same name.


The question is that it is possible to ignore the missing p3 property or I have to return it as dummy data, althout i don't need it just to satisfy EF?
Posted
Updated 17-Nov-13 0:44am
v2
Comments
Sampath Lokuge 17-Nov-13 8:54am    
Which version of EF are you using (4 or 5 or 6)? And code first or what ?

1 solution

Check below mentioned links.May be helped to you.

EF 6 :

Stored Procedure Mapping

EF 4 :

Stored Procedures in the Entity Framework
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900