locked
Stored Procedures RRS feed

  • Question

  • I can see a way of importing functions (Stored Procedures) into the EDM. However they require a return type. Building on my previous post of returning a named type from a data service. Can I project the results of a stored proc in a named type. I can't see a way of doing it? Regards, Chris.

    Monday, September 29, 2008 7:49 PM

Answers

  • Are you trying to do this over EntityFramework or some other provider?

     

    EF V1 has a limitation that the return type of a function import has to be a collection of entities or primitive types. Also the entity type must belong to an entity set - in other words, it can't be standalone entity type.

     

    For other providers, it is more relaxed. The return can be anything. Hence you can project your results into a entity type or complex type. If this complex type is not referenced anywhere in the model, then you add it in our InitializeService method using RegisterKnownType method.

     

    Hope this helps.

     

    Thanks

    Pratik

    Tuesday, September 30, 2008 6:14 PM
    Moderator