Refactor invoice entity to not have to inject the NetworkProvider (#858)

This commit is contained in:
Nicolas Dorier
2019-05-24 22:22:38 +09:00
committed by GitHub
parent 15dc0d60db
commit 512ee16620
11 changed files with 59 additions and 51 deletions

View File

@@ -51,7 +51,7 @@ namespace BTCPayServer.Controllers
})).FirstOrDefault();
if (invoice == null)
throw new BitpayHttpException(404, "Object not found");
var resp = invoice.EntityToDTO(_NetworkProvider);
var resp = invoice.EntityToDTO();
return new DataWrapper<InvoiceResponse>(resp);
}
[HttpGet]
@@ -82,7 +82,7 @@ namespace BTCPayServer.Controllers
};
var entities = (await _InvoiceRepository.GetInvoices(query))
.Select((o) => o.EntityToDTO(_NetworkProvider)).ToArray();
.Select((o) => o.EntityToDTO()).ToArray();
return DataWrapper.Create(entities);
}