Exemplo n.º 1
0
 public IModelContext Create(string connectionString, bool startTrackingChanges)
 {
     var context = new PHmiModelContext(connectionString);
     if (startTrackingChanges)
         context.StartTrackingChanges();
     return context;
 }
Exemplo n.º 2
0
        public IModelContext Create(string connectionString, bool startTrackingChanges)
        {
            var context = new PHmiModelContext(connectionString);

            if (startTrackingChanges)
            {
                context.StartTrackingChanges();
            }
            return(context);
        }
Exemplo n.º 3
0
 public IModelContext Create(string connectionString)
 {
     var entityConnection = new EntityConnection(
             new MetadataWorkspace(
                 new [] { "res://*/" },
                 new [] { Assembly.GetAssembly(typeof(PHmiModelContext)) }),
                 new NpgsqlConnection(connectionString));
     var context = new PHmiModelContext(entityConnection);
     context.StartTrackingChanges();
     return context;
 }
Exemplo n.º 4
0
        public IModelContext Create(string connectionString)
        {
            var entityConnection = new EntityConnection(
                new MetadataWorkspace(
                    new [] { "res://*/" },
                    new [] { Assembly.GetAssembly(typeof(PHmiModelContext)) }),
                new NpgsqlConnection(connectionString));
            var context = new PHmiModelContext(entityConnection);

            context.StartTrackingChanges();
            return(context);
        }