Cleaned-up BuyerRepository.cs
This commit is contained in:
parent
ad01496e32
commit
e36e606d64
@ -11,7 +11,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
|
|||||||
: IBuyerRepository
|
: IBuyerRepository
|
||||||
{
|
{
|
||||||
private readonly OrderingContext _context;
|
private readonly OrderingContext _context;
|
||||||
|
|
||||||
public IUnitOfWork UnitOfWork
|
public IUnitOfWork UnitOfWork
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -29,7 +28,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
|
|||||||
{
|
{
|
||||||
if (buyer.IsTransient())
|
if (buyer.IsTransient())
|
||||||
{
|
{
|
||||||
//TODO: when migrating to ef core 1.1.1 change Add by AddAsync-. A bug in ef core 1.1.0 does not allow to do it https://github.com/aspnet/EntityFramework/issues/7298
|
|
||||||
return _context.Buyers
|
return _context.Buyers
|
||||||
.Add(buyer)
|
.Add(buyer)
|
||||||
.Entity;
|
.Entity;
|
||||||
@ -37,8 +35,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
return buyer;
|
return buyer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Buyer Update(Buyer buyer)
|
public Buyer Update(Buyer buyer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user