Esempio n. 1
0
        /// <summary>
        /// Creates a <see cref="ActiveRecordModel"/> from the specified type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public ActiveRecordModel Create(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (type.IsDefined(typeof(ActiveRecordSkipAttribute), false))
            {
                return(null);
            }

            ActiveRecordModel model = new ActiveRecordModel(type);

            coll.Add(model);

            PopulateModel(model, type);

            ActiveRecordBase.Register(type, model);

            return(model);
        }
Esempio n. 2
0
 /// <summary>
 /// Creates the dummy model for the specified type.
 /// This is required for integration with plain NHibernate entities
 /// </summary>
 /// <param name="type">The type.</param>
 public void CreateDummyModelFor(Type type)
 {
     ActiveRecordBase.Register(type, new ActiveRecordModel(type));
 }