Beispiel #1
0
        public virtual void CopyTo(Sample.CustomerCollection collection, bool deep)
        {
            if ((typeof(System.ICloneable).IsAssignableFrom(typeof(Sample.Customer)) == false))
            {
                deep = false;
            }
            System.Collections.Generic.IEnumerator <Sample.Customer> enumerator = this.GetEnumerator();
            bool b;

            for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
            {
                if ((deep == true))
                {
                    collection.Add(((Sample.Customer)(((System.ICloneable)(enumerator.Current)).Clone())));
                }
                else
                {
                    collection.Add(enumerator.Current);
                }
            }
        }
Beispiel #2
0
 public static Sample.CustomerCollection PageLoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions)
 {
     if ((pageIndex < 0))
     {
         pageIndex = 0;
     }
     if ((pageSize < 0))
     {
         if ((pageOptions != null))
         {
             pageSize = pageOptions.DefaultPageSize;
         }
         else
         {
             pageSize = int.MaxValue;
         }
     }
     Sample.CustomerCollection ret    = new Sample.CustomerCollection();
     System.Data.IDataReader   reader = null;
     try
     {
         reader = Sample.CustomerCollection.PageDataLoadAll(pageOptions);
         if ((reader == null))
         {
             return(ret);
         }
         ret.LoadAll(pageIndex, pageSize, pageOptions, reader);
     }
     finally
     {
         if ((reader != null))
         {
             reader.Dispose();
         }
         CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(Sample.Constants.SampleStoreName);
     }
     return(ret);
 }
Beispiel #3
0
 public virtual Sample.CustomerCollection Clone(bool deep)
 {
     Sample.CustomerCollection ret = new Sample.CustomerCollection();
     this.CopyTo(ret, deep);
     return(ret);
 }
Beispiel #4
0
 public static Sample.CustomerCollection LoadAll()
 {
     Sample.CustomerCollection ret = Sample.CustomerCollection.PageLoadAll(int.MinValue, int.MaxValue, null);
     return(ret);
 }