Beispiel #1
0
        public virtual IEnumerable <TDb> Gets(SqlCePredicateList <TDb> predicates)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();
            Dictionary <Expression <Func <TDb, object> >, string> properties = new Dictionary <Expression <Func <TDb, object> >, string>();
            string operatorConcat = predicates.OperatorConcat;

            int idx = 0;

            foreach (var item in predicates.Predicates)
            {
                properties.Add(item.Property, item.Operator);
                data.Add(string.Format("param{0}", idx), item.Data);
                idx++;
            }

            return(Database.AllDictionary <TDb>(data, operatorConcat, properties));
        }
Beispiel #2
0
        public virtual void DeleteAll(SqlCeTransaction tran,
                                      SqlCePredicateList <TDb> predicates)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();
            Dictionary <Expression <Func <TDb, object> >, string> properties = new Dictionary <Expression <Func <TDb, object> >, string>();
            string operatorConcat = predicates.OperatorConcat;

            int idx = 0;

            foreach (var item in predicates.Predicates)
            {
                properties.Add(item.Property, item.Operator);
                data.Add(string.Format("param{0}", idx), item.Data);
                idx++;
            }

            Database.DeleteAllDictionary <TDb>(tran, data, operatorConcat, properties);
        }