Stored Procedures

  • tsarris 4 years ago

    Can i map a Stored Procedure to a c1DataSource? What if this store procedure has parameters?

  • 2p
    C1_MichaelE2p 4 years ago

    You can use stored procedures when you create an EF model, to map your entity sets to tham, see for example "How to: Define a Model with a Stored Procedure" ( Then you can use those entity sets in C1DataSource and in SEF in general.

  • tsarris 3 years, 9 months ago

    I have this case:
    a stored procedure named Humans with parameters JobID and ReadinessDate and i have a complex type for this named: HumanResults.
    How can i use c1datasource or direclty scope.getitems with this?
    Can you give me an example please?

  • 3p
    C1_NodirT3p 3 years, 9 months ago

    Unfortunately, this is not supported in SEF yet. ClientScope.GetItems and C1DataSource can retrieve entity sets only.

    We will consider adding this feature. Thank you for the feedback.

  • 3p
    C1_NodirT3p 3 years, 9 months ago

    I might make you think that stored procedures are not supported at all, but this is not true.

    If a stored procedure returns Complex Type objects, then you can use the procedure as is because Complex Type objects are not tracked.

    Otherwise, if it returns entities, you can execute it together with DataExtensions.ExecuteIn extension method like this:

    var entities = context.MyStoredProcedure()

    Alternatively, you can add the retrieved entities to the ClientScope using the AddRef method:

    var entities = context.MyStoredProcedure().ToList();
    foreach(var e in entities) { 


  • tsarris 3 years, 9 months ago

    Thank you very much

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.