Example #1
0
        internal static IList <IProperty> FilterProperty <K1, K2>(IEntityMapper <T> mapper, IEntityMapper <K1> k1Mapper, IEntityMapper <K2> k2Mapper, IRelevance[] relevances, JoinType join, out string relevanceStr, IEnumerable <IProperty> disabled = null)
        {
            var s  = new string[2];
            var p1 = DBbatBuilder <T> .FilterProperty <K1>(mapper, k1Mapper, relevances[0], join, out s[0], disabled);

            var p2 = DBbatBuilder <T> .FilterProperty <K2>(mapper, k2Mapper, relevances[1], join, out s[1], disabled);

            int index = s[1].IndexOf(JoinString(join));

            s[1]         = s[1].Substring(index - 1);
            relevanceStr = string.Join(" ", s);
            return(p1.Union(p2).ToList());
        }
Example #2
0
        public int ExecuteNonQuery(string commandText, object paramObj = null)
        {
            try
            {
                var com = this._conn.GetIDbCommand(this._mapper.ServiceKey);
                com.CommandText = commandText;
                DBbatBuilder <T> .SetCommandParameter(commandText, com.Parameters, this.CreaterParamger, paramObj);

                return(com.ExecuteNonQuery());
            }
            finally
            {
                this._conn.Close();
            }
        }
Example #3
0
        public void Execute <K>(IList <T> entitys, string commandText, object paramObj = null) where K : DataEntity, new()
        {
            try
            {
                var com = this._conn.GetIDbCommand(this._mapper.ServiceKey);
                com.CommandText = commandText;
                DBbatBuilder <T> .SetCommandParameter(commandText, com.Parameters, this.CreaterParamger, paramObj);

                using (var read = com.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    var rs = ReaderDataEntity.CreaterReaderDataEntity <T, K>(this._entity, read, this._mapper);
                    rs.FullDataEntity <T>(entitys, read);
                }
            }
            finally
            {
                this._conn.Close();
            }
        }