Example #1
0
 public MappingEntity(EntityConstructorDescriptor constructorDescriptor)
 {
     this.ConstructorDescriptor       = constructorDescriptor;
     this.ConstructorParameters       = new Dictionary <ParameterInfo, int>();
     this.ConstructorEntityParameters = new Dictionary <ParameterInfo, IObjectActivatorCreator>();
     this.Members       = new Dictionary <MemberInfo, int>();
     this.EntityMembers = new Dictionary <MemberInfo, IObjectActivatorCreator>();
 }
 public MappingObjectExpression(EntityConstructorDescriptor constructorDescriptor)
 {
     this.ConstructorDescriptor        = constructorDescriptor;
     this.MappingConstructorParameters = new Dictionary <ParameterInfo, DbExpression>();
     this.ComplexConstructorParameters = new Dictionary <ParameterInfo, IMappingObjectExpression>();
     this.MappingMembers = new Dictionary <MemberInfo, DbExpression>();
     this.ComplexMembers = new Dictionary <MemberInfo, IMappingObjectExpression>();
 }
Example #3
0
 public MappingObjectExpression(EntityConstructorDescriptor constructorDescriptor)
 {
     this.ConstructorDescriptor       = constructorDescriptor;
     this.ConstructorParameters       = new Dictionary <ParameterInfo, DbExpression>();
     this.ConstructorEntityParameters = new Dictionary <ParameterInfo, IMappingObjectExpression>();
     this.SelectedMembers             = new Dictionary <MemberInfo, DbExpression>();
     this.SubResultEntities           = new Dictionary <MemberInfo, IMappingObjectExpression>();
 }
Example #4
0
 public MappingEntity(EntityConstructorDescriptor constructorDescriptor)
 {
     this.ConstructorDescriptor = constructorDescriptor;
     this.ConstructorParameters = new Dictionary<ParameterInfo, int>();
     this.ConstructorEntityParameters = new Dictionary<ParameterInfo, IObjectActivatorCreator>();
     this.Members = new Dictionary<MemberInfo, int>();
     this.EntityMembers = new Dictionary<MemberInfo, IObjectActivatorCreator>();
 }
Example #5
0
            static ObjectActivator CreateObjectActivator(Type type, IDataReader reader)
            {
                EntityConstructorDescriptor constructorDescriptor = EntityConstructorDescriptor.GetInstance(type.GetConstructor(Type.EmptyTypes));
                EntityMemberMapper          mapper = constructorDescriptor.GetEntityMemberMapper();
                Func <IDataReader, ReaderOrdinalEnumerator, ObjectActivatorEnumerator, object> instanceCreator = constructorDescriptor.GetInstanceCreator();
                List <IValueSetter> memberSetters = PrepareValueSetters(type, reader, mapper);

                return(new ObjectActivator(instanceCreator, null, null, memberSetters, null));
            }
Example #6
0
            static ObjectActivator CreateObjectActivator(Type type, IDataReader reader)
            {
                ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes);

                if (constructor == null)
                {
                    throw new ArgumentException(string.Format("The type of '{0}' does't define a none parameter constructor.", type.FullName));
                }

                EntityConstructorDescriptor constructorDescriptor = EntityConstructorDescriptor.GetInstance(constructor);
                EntityMemberMapper          mapper = constructorDescriptor.GetEntityMemberMapper();
                Func <IDataReader, ReaderOrdinalEnumerator, ObjectActivatorEnumerator, object> instanceCreator = constructorDescriptor.GetInstanceCreator();
                List <IValueSetter> memberSetters = PrepareValueSetters(type, reader, mapper);

                return(new ObjectActivator(instanceCreator, null, null, memberSetters, null));
            }
 public MappingObjectExpression(ConstructorInfo constructor)
     : this(EntityConstructorDescriptor.GetInstance(constructor))
 {
 }