Fix warnings

This commit is contained in:
nicolas.dorier 2020-10-26 14:18:38 +09:00
parent c8dd13577e
commit a30456a92d
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
4 changed files with 5 additions and 7 deletions

View File

@ -65,7 +65,7 @@ namespace BTCPayServer.HostedServices
readonly CompositeDisposable leases = new CompositeDisposable();
private async Task UpdateInvoice(UpdateInvoiceContext context)
private void UpdateInvoice(UpdateInvoiceContext context)
{
var invoice = context.Invoice;
if (invoice.Status == InvoiceStatus.New && invoice.ExpirationTime <= DateTimeOffset.UtcNow)
@ -283,7 +283,7 @@ namespace BTCPayServer.HostedServices
if (invoice == null)
break;
var updateContext = new UpdateInvoiceContext(invoice);
await UpdateInvoice(updateContext);
UpdateInvoice(updateContext);
if (updateContext.Unaffect)
{
await _InvoiceRepository.UnaffectAddress(invoice.Id);

View File

@ -808,23 +808,19 @@ namespace BTCPayServer.Services.Invoices
public bool CanMarkComplete()
{
return (Status == InvoiceStatus.Paid) ||
#pragma warning disable CA1305 // Specify IFormatProvider
((Status == InvoiceStatus.New || Status == InvoiceStatus.Expired) && ExceptionStatus == InvoiceExceptionStatus.PaidPartial) ||
((Status == InvoiceStatus.New || Status == InvoiceStatus.Expired) && ExceptionStatus == InvoiceExceptionStatus.PaidLate) ||
(Status != InvoiceStatus.Complete && ExceptionStatus == InvoiceExceptionStatus.Marked) ||
(Status == InvoiceStatus.Invalid);
#pragma warning restore CA1305 // Specify IFormatProvider
}
public bool CanMarkInvalid()
{
return (Status == InvoiceStatus.Paid) ||
(Status == InvoiceStatus.New) ||
#pragma warning disable CA1305 // Specify IFormatProvider
((Status == InvoiceStatus.New || Status == InvoiceStatus.Expired) && ExceptionStatus == InvoiceExceptionStatus.PaidPartial) ||
((Status == InvoiceStatus.New || Status == InvoiceStatus.Expired) && ExceptionStatus == InvoiceExceptionStatus.PaidLate) ||
(Status != InvoiceStatus.Invalid && ExceptionStatus == InvoiceExceptionStatus.Marked);
#pragma warning restore CA1305 // Specify IFormatProvider;
}
public override int GetHashCode()

View File

@ -330,7 +330,9 @@ retry:
var paymentMethodIdStr = paymentMethodId?.ToString();
var addresses = context.HistoricalAddressInvoices.Where(data =>
(data.InvoiceDataId == invoiceId && paymentMethodIdStr == null ||
#pragma warning disable CS0618 // Type or member is obsolete
data.CryptoCode == paymentMethodIdStr) &&
#pragma warning restore CS0618 // Type or member is obsolete
data.UnAssigned == null);
foreach (var historicalAddressInvoiceData in addresses)
{

View File

@ -95,7 +95,7 @@ namespace BTCPayServer.Services.Notifications
query = query.Where(store => store.DisabledNotifications != "all");
foreach (string term in terms)
{
query = query.Where(user => user.DisabledNotifications == null || !user.DisabledNotifications.Contains(term));
query = query.Where(user => user.DisabledNotifications == null || !user.DisabledNotifications.Contains(term, StringComparison.OrdinalIgnoreCase));
}
return query.Select(user => user.Id).ToArray();