mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
commit
05f99f3855
@ -536,11 +536,11 @@ namespace BTCPayServer.Services.Invoices
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<InvoiceEntity> GetInvoice(string id, bool inludeAddressData = false)
|
public async Task<InvoiceEntity> GetInvoice(string id, bool includeAddressData = false)
|
||||||
{
|
{
|
||||||
using (var context = _applicationDbContextFactory.CreateContext())
|
using (var context = _applicationDbContextFactory.CreateContext())
|
||||||
{
|
{
|
||||||
var res = await GetInvoiceRaw(id, context, inludeAddressData);
|
var res = await GetInvoiceRaw(id, context, includeAddressData);
|
||||||
return res == null ? null : ToEntity(res);
|
return res == null ? null : ToEntity(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -559,13 +559,13 @@ namespace BTCPayServer.Services.Invoices
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<InvoiceData> GetInvoiceRaw(string id, ApplicationDbContext dbContext, bool inludeAddressData = false)
|
private async Task<InvoiceData> GetInvoiceRaw(string id, ApplicationDbContext dbContext, bool includeAddressData = false)
|
||||||
{
|
{
|
||||||
IQueryable<Data.InvoiceData> query =
|
IQueryable<Data.InvoiceData> query =
|
||||||
dbContext
|
dbContext
|
||||||
.Invoices
|
.Invoices
|
||||||
.Include(o => o.Payments);
|
.Include(o => o.Payments);
|
||||||
if (inludeAddressData)
|
if (includeAddressData)
|
||||||
query = query.Include(o => o.HistoricalAddressInvoices).Include(o => o.AddressInvoices);
|
query = query.Include(o => o.HistoricalAddressInvoices).Include(o => o.AddressInvoices);
|
||||||
query = query.Where(i => i.Id == id);
|
query = query.Where(i => i.Id == id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user