public void BeforeNHibernateInitialization()
 {
     ActiveRecordStarter.ModelsValidated += delegate
     {
         foreach (Type type in RhinoSecurity.Entities)
         {
             modelBuilder.CreateDummyModelFor(type);
         }
     };
 }
Example #2
0
        static void CreateDummyModelsForRhinoSecurityClasses(ActiveRecordModelCollection models, IConfigurationSource source)
        {
            var modelBuilder = new ActiveRecordModelBuilder();

            foreach (Type type in RhinoSecurity.Entities)
            {
                if (!models.Contains(type))
                {
                    modelBuilder.CreateDummyModelFor(type);
                }
            }
        }
        public override string[] GetMappings()
        {
            List <string>            mapping = new List <string>();
            ActiveRecordModelBuilder builder = new ActiveRecordModelBuilder();

            foreach (Type type in RhinoSecurity.Entities)
            {
                builder.CreateDummyModelFor(type);
                Stream stream = type.Assembly.GetManifestResourceStream(type.FullName + ".hbm.xml");
                if (stream == null)
                {
                    continue;
                }
                using (StreamReader reader = new StreamReader(stream))
                    mapping.Add(reader.ReadToEnd());
            }
            return(mapping.ToArray());
        }