示例#1
0
        internal List <T> StoredProcToList <T>(string storedproc, GenericMapper <T> mapper, params DbParameter[] @params) where T : new()
        {
            var list = new List <T>();

            StoredProcReaderForEach(storedproc, reader => list.Add(mapper.Map(reader)), @params);

            return(list);
        }
示例#2
0
        internal T StoredProcGetOne <T>(string storedproc, GenericMapper <T> mapper, params DbParameter[] @params) where T : new()
        {
            T ret = default(T);

            StoredProcReaderFirst(storedproc, reader => {
                ret = mapper.Map(reader);
            }, @params);
            return(ret);
        }
示例#3
0
        public GenericMapper <T> build()
        {
            var mapper = new GenericMapper <T>();

            mapper.Overrides     = _overrides.ToArray();
            mapper.Mappings      = _mappings.ToArray();
            mapper.PostMapAction = _postMapAction;
            mapper.ColumnIgnores = _columnIgnores;
            return(mapper);
        }
        public List <Kingdom> GetKingdomList()
        {
            var mapper = new GenericMapper <Kingdom>();

            return(StoredProcToList("spBiotaDefKingdomList", mapper));
        }