示例#1
0
 public async Task <Sequence> GetNext(String key)
 {
     if (String.IsNullOrEmpty(key))
     {
         throw new HttpRequestException("The key should not be NULL!");
     }
     else
     {
         using (var dbFactory = new DbContextFactory(this._env.EnvironmentName))
             using (var allocatorMng = new AllocatorManager(dbFactory))
             {
                 var seq = allocatorMng.GetNextVal(key, this.getValProvider);
                 base._logger.Trace($"{key} Get {seq.Value}");
                 return(seq);
             }
     }
 }