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

            if (startTrackingChanges)
            {
                context.StartTrackingChanges();
            }
            return(context);
        }
 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;
 }
Beispiel #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);
        }