コード例 #1
0
 /// <summary>
 /// 按时间范围创建Scope,范围错误时,可能为空。
 /// </summary>
 public List <ContextScope> Scope(DateTime start, DateTime end, bool avoidFutureTime = true)
 {
     return(ContextScope.Create(_dbConfig.ScopeType, start, end, avoidFutureTime));
     //if (scopes.IsNullOrEmpty()) scopes = scopes.NullableAdd(Scope(start));
 }
コード例 #2
0
 /// <summary>
 /// DateTime.Today 在当前ScopeType下的ContextScope。
 /// </summary>
 public static ContextScope Today(this ShardScopeType scopeType)
 {
     return(ContextScope.Create(scopeType, DateTime.Today));
 }
コード例 #3
0
 /// <summary>
 /// 按时间创建Scope
 /// </summary>
 public ContextScope Scope(DateTime date)
 {
     return(ContextScope.Create(_dbConfig.ScopeType, date));
 }