Beispiel #1
0
        protected override T Binding(SqlDataReader aReader)
        {
            T data = new T();

            PropertyBinder.BindProperty <T>(
                delegate(PropertyMap aMap)
            {
                BindValue(aMap, aReader, data);
            },
                delegate(IdentityMap aMap)
            {
                BindValue(aMap, aReader, data);
            },
                delegate(PropertyMap aMap, MemberInfo[] aWrapperParents)
            {
                var field = ValueExtractor.GetValue(data, aWrapperParents);
                BindValue(aMap, aReader, field);
            }
                );
            return(data);
        }
Beispiel #2
0
        public List <Property> GetProperties <T>(T aData, bool isBindNull) where T : class, new()
        {
            var memberList = new List <Property>();

            propertyBinder.BindProperty <T>(

                delegate(PropertyMap aMap)
            {
                AppendMember(memberList, aMap, aData, isBindNull);
            },
                delegate(IdentityMap aMap)
            {
                AppendMember(memberList, aMap, aData, isBindNull);
            },
                delegate(PropertyMap aMap, MemberInfo[] aWrapperParents)
            {
                var field = extractor.GetValue(aData, aWrapperParents);
                AppendMember(memberList, aMap, field, isBindNull);
            });

            return(memberList);
        }
        protected override T Binding(SqlDataReader aReader)
        {
            T data = new T();

            PropertyBinder.BindProperty <T>(
                null,
                delegate(IdentityMap aMap)
            {
                Bind(aMap, aReader, data);
            },
                null
                );

            return(data);
        }
Beispiel #4
0
        internal InsertUpdateQuery(PropertyBinder aBinder, T aData, bool isNullBind, ValueExtractor anExtractor)
            : base(aBinder)
        {
            ValueBinder valuebinder = Database.Current.Factory.GetValueBinder();

            aBinder.BindProperty <T>(

                delegate(PropertyMap aMap)
            {
                valuebinder.BindValue(query.GetStatement(), aMap, aData, isNullBind);
            },
                delegate(IdentityMap aMap)
            {
                setIdentity(aMap.GetColumn());
            },
                delegate(PropertyMap aMap, MemberInfo[] aParentsMembers)
            {
                var field = anExtractor.GetValue(aData, aParentsMembers);
                valuebinder.BindValue(query.GetStatement(), aMap, field, isNullBind);
            });
        }
Beispiel #5
0
        public SelectQuery(PropertyBinder aBinder)
            : base(aBinder)
        {
            PropertyBinder.BindProperty <T>(

                delegate(PropertyMap aMap)
            {
                query.GetStatement().AddField(
                    String.Format(SqlSyntax.DBFIELD, tableName, aMap.GetColumn()));
            },
                delegate(IdentityMap aMap)
            {
                query.GetStatement().AddField(
                    String.Format(SqlSyntax.DBFIELD, tableName, aMap.GetColumn()));
            },
                delegate(PropertyMap aMap, MemberInfo[] aParentsMembers)
            {
                query.GetStatement().AddField(
                    String.Format(SqlSyntax.DBFIELD, tableName, aMap.GetColumn()));
            });
        }