Ef global asax open db connection

751 views Asked by At

how can i open db connection in global asax file. For example i am trying to open in

using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using EDefterWAP.Helpers;
using EDocSis.DAL;
using System.Configuration;

namespace EDefterWAP
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
 protected void Application_EndRequest()
        {
            IEDefterDB db = DBContext.CreateInstance(ConfigurationManager.ConnectionStrings["EDocSis.DAL.EDefterDB"].ConnectionString);
        db.KurumVeriAktarimlari.

        }

i can't write where condition after db.KurumVeriAktarimlari ? What is the problem?

1

There are 1 answers

0
Tommy On BEST ANSWER

It looks like you are missing a using statement.

using System.Linq;

This assembly contains the information for the Where(), First(), etc lambdas.