Esempio n. 1
0
 public static SoodaObject SelectSingleObjectWC(Sooda.SoodaWhereClause expr, ISoodaObjectList list)
 {
     if (list.Count == 0)
     {
         return(null);
     }
     if (list.Count > 1)
     {
         throw new SoodaObjectNotFoundException("Not a unique match: '" + expr + "'");
     }
     return(list.GetItem(0));
 }
Esempio n. 2
0
        public static ISoodaObjectList ToSoodaObjectList <T>(this IEnumerable <T> source) where T : SoodaObject
        {
            ISoodaObjectList list = source as ISoodaObjectList;

            if (list != null)
            {
                return(list);
            }

            SoodaQueryable <T> query = source as SoodaQueryable <T>;

            if (query != null)
            {
                return(query.Execute <ISoodaObjectList>());
            }

            SoodaObjectListSnapshot snapshot = new SoodaObjectListSnapshot();

            foreach (SoodaObject o in source)
            {
                snapshot.Add(o);
            }
            return(snapshot);
        }
Esempio n. 3
0
 public static SoodaObject SelectSingleObjectBE(Sooda.QL.SoqlBooleanExpression expr, ISoodaObjectList list)
 {
     if (list.Count == 0)
         return null;
     if (list.Count > 1)
         throw new SoodaObjectNotFoundException("Not a unique match: '" + expr + "'");
     return list.GetItem(0);
 }
Esempio n. 4
0
 public static SoodaObject SelectSingleObjectWC(Sooda.SoodaWhereClause expr, ISoodaObjectList list)
 {
     if (list.Count == 0)
         return null;
     if (list.Count > 1)
         throw new SoodaObjectNotFoundException("Not a unique match: '" + expr + "'");
     return list.GetItem(0);
 }
Esempio n. 5
0
 public SoodaObjectCollectionWrapperGeneric(ISoodaObjectList list)
 {
     _theList = list;
 }
Esempio n. 6
0
 public SoodaObjectCollectionWrapperGeneric()
 {
     _theList = new SoodaObjectListSnapshot();
 }
Esempio n. 7
0
 public static SoodaObject SelectSingleObjectBE(Sooda.QL.SoqlBooleanExpression expr, ISoodaObjectList list)
 {
     if (list.Count == 0)
     {
         return(null);
     }
     if (list.Count > 1)
     {
         throw new SoodaObjectNotFoundException("Not a unique match: '" + expr + "'");
     }
     return(list.GetItem(0));
 }