예제 #1
0
파일: StateStorage.cs 프로젝트: tokeLiu/Ray
 public Task DeleteAsync(K id)
 {
     return(SQLTask.SQLTaskExecute(async() =>
     {
         using (var conn = tableInfo.CreateConnection())
         {
             await conn.ExecuteAsync(deleteSql, new { StateId = id });
         }
     }));
 }
예제 #2
0
파일: EventStorage.cs 프로젝트: zmk523/Ray
        public async Task CompleteAsync <T>(T data) where T : IEventBase <K>
        {
            var table = await tableInfo.GetTable(data.Timestamp);

            if (!completeSqlDict.TryGetValue(table.Name, out var sql))
            {
                sql = $"UPDATE {table.Name} set iscomplete=TRUE where id=@Id";
                completeSqlDict.TryAdd(table.Name, sql);
            }
            using (var conn = tableInfo.CreateConnection())
            {
                await conn.ExecuteAsync(sql, new { Id = data.Id });
            }
        }