Esempio n. 1
0
        /// <summary>初始化</summary>
        public override void Init()
        {
            var fi = Field;

            // 自动找时间字段
            if (fi == null && FieldName.IsNullOrEmpty())
            {
                fi = Field = Factory.MasterTime;
            }

            base.Init();

            fi = Field;
            if (fi == null)
            {
                throw new ArgumentNullException(nameof(FieldName), "未指定用于顺序抽取数据的时间字段!");
            }
            FieldName = fi.Name;

            // 先按时间升序,再按主键升序,避免同一秒存在多行数据时,数据顺序不统一
            var sort = fi.Asc();
            var uq   = Factory.Unique;

            if (uq != null && uq.Name != fi.Name)
            {
                sort &= uq.Asc();
            }

            OrderBy = sort;
        }
Esempio n. 2
0
 /// <summary>初始化</summary>
 public virtual void Init()
 {
     // 自动找时间字段
     if (FieldName.IsNullOrEmpty())
     {
         var fi = Factory.Fields.FirstOrDefault(e => e.Type == typeof(DateTime) && e.Name.StartsWithIgnoreCase("UpdateTime", "Modify", "Modified"));
         if (fi != null)
         {
             FieldName = fi.Name;
         }
     }
 }
Esempio n. 3
0
        /// <summary>初始化</summary>
        public virtual void Init()
        {
            var fi = Field;

            // 自动找字段
            if (fi == null && !FieldName.IsNullOrEmpty())
            {
                fi = Field = Factory?.Table.FindByName(FieldName);
            }

            if (fi == null)
            {
                throw new ArgumentNullException(nameof(FieldName), "未指定用于顺序抽取数据的排序字段!");
            }
        }
Esempio n. 4
0
 /// <summary>初始化</summary>
 public virtual void Init()
 {
     // 自动找时间字段
     if (FieldName.IsNullOrEmpty())
     {
         var fi = Factory.MasterTime;
         if (fi != null)
         {
             FieldName = fi.Name;
         }
     }
     if (Field == null)
     {
         throw new ArgumentNullException(nameof(FieldName), "未指定用于顺序抽取数据的时间字段!");
     }
 }
        /// <summary>初始化</summary>
        public override void Init()
        {
            var fi = Field;

            // 自动找自增字段
            if (fi == null && FieldName.IsNullOrEmpty())
            {
                fi = Field = Factory.Table.Identity;
            }

            base.Init();

            fi = Field;
            if (fi == null)
            {
                throw new ArgumentNullException(nameof(FieldName), "未指定用于顺序抽取数据的自增字段!");
            }

            OrderBy = fi.Asc();
        }