entity framework - The type Parameter in Execute Function is incompatible with the type returned by the function -
i'm getting following error when trying import stored proc function in entity framework 5. have updated data project reference new version of ef.
the type parameter 'ssds.data.testy_result' in executefunction incompatible type 'ssds.data.testy_result' returned function.
i can't work stored proc...here simple test one:
create procedure testy begin select 'hello' hello end go
it breaks exception above here:
public virtual objectresult<testy_result> testy() { return ((iobjectcontextadapter)this).objectcontext.executefunction<testy_result>("testy"); }
and there no error when set result string scalar in edit function import window in model designer.
i'm calling function this:
private entities db = new entities(); var x = db.testy();
is there obvious i'm missing here? there few edmx files in project , others created older version of ef (and use objectcontext).
function mappings:
more function mappings detail:
testy_result class:
public partial class testy_result { public string hello { get; set; } }
i've been struggling same problem last few days. project had been upgraded previous version of entity framework 5.0. figured out due having mix of old , new edmxs. removing old edmx allowed new 1 work, of course that's not viable solution. able work changing code generation strategy new (ef 5) edmx "legacy objectcontext". if you're not familiar, can found opening edmx diagram, right-clicking, , going properties. suspect edmxs in project need on same code generation strategy, change old ones t4 instead, although involve more work.
Comments
Post a Comment