Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Include from System.Data.Entity not found #2278


User avatar
0
benjaminrivero created

On this part of the tutorial:

<a class="postlink" href="https://www.aspnetzero.com/Documents/Developing-Step-By-Step-Mvc-Angularjs#changing-getpeople-method">https://www.aspnetzero.com/Documents/De ... ple-method</a>

comes an example using "Include" extension method for bring relation with Phones

var persons = _personRepository
        .GetAll()
        .Include(p => p.Phones)
        .WhereIf(
            !input.Filter.IsNullOrEmpty(),
            p => p.Name.Contains(input.Filter) ||
                    p.Surname.Contains(input.Filter) ||
                    p.EmailAddress.Contains(input.Filter)
        )
        .OrderBy(p => p.Name)
        .ThenBy(p => p.Surname)
        .ToList();

I am making a custom application follow that example with Angular 1, Module Zero and Entity Framework, and on one of my AppService files on the Application Layer. I am trying to do the same thing, using the Include extension method, but the problem is that this method is not recognized, there is no "using" that solve this problem, I can't compile. I read that this belong to System.Data.Entity so add this "using" but is not working.


1 Answer(s)
  • User Avatar
    0
    benjaminrivero created

    I figure that is (now obviously) required include Entity Framework Package in Application Project. (where the DTO Resides)

    Just open console, set Project default to Application and install Entity Framework