示例#1
0
    public async Task <DateTime> GetLastNotificationDateAsync(string ruleId)
    {
        var model = await _myNoSqlServerDataWriter.GetAsync(NotificationNoSql.GeneratePartitionKey(),
                                                            NotificationNoSql.GenerateRowKey(ruleId));

        return(model?.CreatedDate ?? DateTime.MinValue);
    }
示例#2
0
    public async Task AddOrUpdateAsync(string ruleId, DateTime expires)
    {
        var nosqlModel = NotificationNoSql.Create(ruleId, expires);
        await _myNoSqlServerDataWriter.InsertOrReplaceAsync(nosqlModel);

        await _myNoSqlServerDataWriter.CleanAndKeepMaxRecords(NotificationNoSql.GeneratePartitionKey(), 3500);
    }