Exemplo n.º 1
0
        /// <summary>
        /// get rebuilt kv list
        /// </summary>
        /// <param name="configid"></param>
        /// <returns></returns>
        public List <KeyValuePair <AppConfigs.SingleCardStatus, int> > CountStatus(string configid)
        {
            var originals = AppConfigs.GetStatusSingleCard(); //orignal enum data.

            List <KeyValuePair <AppConfigs.SingleCardStatus, int> > dbList = _DAL.CountStatus(configid);

            List <KeyValuePair <AppConfigs.SingleCardStatus, int> > rslt = new List <KeyValuePair <AppConfigs.SingleCardStatus, int> >();

            foreach (var item in originals)
            {
                if (!dbList.Any(a => a.Key == (AppConfigs.SingleCardStatus)item.Key))
                {
                    rslt.Add(new KeyValuePair <AppConfigs.SingleCardStatus, int>((AppConfigs.SingleCardStatus)item.Key, 0));
                }
            }

            rslt.AddRange(dbList);

            return(rslt);
        }