Ejemplo n.º 1
0
        private static void LoadObjectModel(this Oms oms, MochaClassLibraryObjectModel mcl)
        {
            foreach (MochaTenant tenant in mcl.Tenants)
            {
                oms.DefaultTenant = oms.GetTenant(tenant.Name);
                if (oms.DefaultTenant.IsEmpty)
                {
                    throw new InvalidOperationException("attempted to load snapshot for nonexistent tenant");
                }

                oms.BeginTransaction();
                for (int j = 0; j < tenant.Instances.Count; j++)
                {
                    oms.CreateInstance(tenant.Instances[j].ID, Guid.Empty);
                }
                oms.CommitTransaction();
            }
        }
Ejemplo n.º 2
0
        private static void LoadMCX(this Oms oms, MochaSnapshotObjectModel mcx)
        {
            foreach (MochaSnapshotTransaction t in mcx.Transactions)
            {
                oms.DefaultTenant = oms.GetTenant(t.TenantName);
                if (oms.DefaultTenant.IsEmpty)
                {
                    throw new InvalidOperationException("attempted to load snapshot for nonexistent tenant");
                }

                oms.BeginTransaction();
                for (int j = 0; j < t.Operations.Count; j++)
                {
                    oms.LoadMCXOperation(t.Operations[j]);
                }
                oms.CommitTransaction();
            }
        }