Exemplo n.º 1
0
        public override void UpdateOrCreateSchema(SchemaStatus SchemaStatus)
        {
            if (XpoDefault.DataLayer == null)
            {
                using (var updateDataLayer =
                           new SimpleDataLayer(Dictionary, CreateUpdatingDataStore(true)))

                {
                    //HACK you can use any of the following versions to pass persistent types or assemblies
                    //updateDataLayer.UpdateSchema(false, dictionary.CollectClassInfos(GetPersistentTypes()));
                    if (Assemblies != null)
                    {
                        updateDataLayer.UpdateSchema(false, Dictionary.CollectClassInfos(Assemblies));

                        new UnitOfWork(updateDataLayer).CreateObjectTypeRecords();
                        return;
                    }

                    if (PersistentTypes != null)
                    {
                        updateDataLayer.UpdateSchema(false, Dictionary.CollectClassInfos(PersistentTypes));

                        new UnitOfWork(updateDataLayer).CreateObjectTypeRecords();
                        return;
                    }

                    throw new Exception(Message);
                }
            }
        }
        public override void UpdateOrCreateSchema(SchemaStatus SchemaStatus)
        {
            switch (SchemaStatus)
            {
            case SchemaStatus.None:

                break;

            case SchemaStatus.SchemaDoesNotExist:
                Context.Database.EnsureCreated();
                break;

            case SchemaStatus.SchemaNeedsToBeUpdated:
                Context.Database.Migrate();
                break;
            }
        }
 public virtual void UpdateOrCreateSchema(SchemaStatus SchemaStatus)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public SchemaMismatchEventArgs(IDataSpaceProvider DataSpaceProvider, SchemaStatus SchemaStatus)
 {
     this.DataSpaceProvider = DataSpaceProvider;
     this.SchemaStatus      = SchemaStatus;
 }