create a generic entitytype instance in entity framework RRS feed

  • Question

  • Hi, i'm new to Entity Frame Work so i want to know is it possible to create a generic global instance of entity type that in some condition can be an instance of lets say orders entity type and in other condition can be an instance of returned_orders because these entity types have the same scalar and navigation properties. 
    Saturday, June 14, 2014 10:36 PM


  • Hello,

    From your description, it seems that you are trying to replace the returned type of the stored procedure(I assume it a SP because usually the returned_entitytype comes from stored procedure,), if it is, it is possible, for this, you need to specify the returned type when you imported the stored procedure as:

    I would like suggest you having a try firstly and if you meet any issue, then post it to here.

    If i misunderstand, please let me know.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 16, 2014 3:38 AM