public async Task <DateTime> GetLastNotificationDateAsync(string ruleId) { var model = await _myNoSqlServerDataWriter.GetAsync(NotificationNoSql.GeneratePartitionKey(), NotificationNoSql.GenerateRowKey(ruleId)); return(model?.CreatedDate ?? DateTime.MinValue); }
public async Task AddOrUpdateAsync(string ruleId, DateTime expires) { var nosqlModel = NotificationNoSql.Create(ruleId, expires); await _myNoSqlServerDataWriter.InsertOrReplaceAsync(nosqlModel); await _myNoSqlServerDataWriter.CleanAndKeepMaxRecords(NotificationNoSql.GeneratePartitionKey(), 3500); }