示例#1
0
        public static void RemoveSchema(EntitySchema schema)
        {
            if ( !schemas.ContainsKey(schema.EntityType) )
             {
            throw new SchemaNotFoundException(schema.EntityType);
             }

             schemas.Remove(schema.EntityType);

             if ( SchemaRemoved != null )
             {
            SchemaRemoved(null, new SchemaCollectionChangedEventArgs { Schema = schema });
             }
        }
示例#2
0
        public static void AddSchema(EntitySchema schema)
        {
            if ( schemas.ContainsKey(schema.EntityType) )
             {
            throw new DuplicateSchemaException(schema.EntityType);
             }

             schemas[schema.EntityType] = schema;

             if ( SchemaAdded != null )
             {
            SchemaAdded(null, new SchemaCollectionChangedEventArgs { Schema = schema });
             }
        }