0

I tried to use CreateQuery method or ExecuteStoreQuery by refrening the below link

Actually I need to Get the data using MYSQL query but i didn't find any method for that i am trying with the sql method in entity those are also not working, like this how to add MySQL query in Entity Framework? http://www.entityframeworktutorial.net/Querying-with-EDM.aspx

I added both the namespace

                    using System.Data.Objects;
                    using System.Data.Entity;

still I didn't get those two methods can any one help me

enter image description here

Thewads
  • 4,953
  • 11
  • 55
  • 71
stpdevi
  • 1,114
  • 3
  • 15
  • 36

1 Answers1

1

Since ESQL was considered an advanced use case, there is no straightforward API from DbContext. You can access the ObjectContext that backs your DbContext to do what you want:

        ((IObjectContextAdapter)context).ObjectContext.CreateQuery<Person>("esql..")

Refer Below Link

Can't find CreateQuery() method

Community
  • 1
  • 1
user123
  • 820
  • 3
  • 14
  • 34