コード例 #1
0
 public static async Task <int> SubmitZeroActivityReminderAsync(Guid userId, int period)
 {
     using (var dbHelper = DbHelper.CreateLogDbHelper())
     {
         using (var cmd = new SqlCommand(InsertZeroActivityReminder))
         {
             cmd.CommandType = CommandType.Text;
             cmd.Parameters.AddWithValue("@UserID", userId);
             cmd.Parameters.AddWithValue("@Period", period);
             var count = Convert.ToInt32(await dbHelper.ExecuteScalarAsync(cmd));
             if (count > 0)
             {
                 await RedisHelper.CreateZeroActivityReminderCache(userId, period);
             }
             return(count);
         }
     }
 }