protected void OnSelect(object sender, GenericSelectArgs args)
        {
            IQueryable res;

            if (Data == null)
            {
                var set = Context.Set <TElement>();
                if (Where != null)
                {
                    res = Where(set);
                }
                else
                {
                    res = set;
                }
            }
            else
            {
                if (Where != null)
                {
                    res = Where(Data());
                }
                else
                {
                    res = Data();
                }
            }

            args.SetData(res, DoSelect);
        }
Exemple #2
0
        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
        {
            GenericSelectArgs args = new GenericSelectArgs(arguments)
            {
            };

            var theResult = this.Owner.Select(args);

            return(theResult);
        }
Exemple #3
0
 public virtual void OnExecuteSelect(GenericSelectArgs a)
 {
     if (ExecuteSelect != null)
     {
         ExecuteSelect(this, a);
     }
     else if (!this.DisableSelect)
     {
         throw new NotImplementedException(string.Format(@"ExecuteSelect Handler for the GenericDataSource '{0}' is not implemented. Set DisableSelect=True -for Insert only scenarios-, else implement the Select Handler", this.ID));
     }
 }
Exemple #4
0
 public virtual IEnumerable Select(GenericSelectArgs args)
 {
     args.AutoPage = this.AutoPage;
     args.AutoSort = this.AutoSort;
     if (this.ExecuteSelect != null)
     {
         ExecuteSelect(this, args);
     }
     else
     {
         OnExecuteSelect(args);
     }
     return(DataSource = args.DataSource);
 }