Shady nagy/net6 (#614)

* udated to .net6

* used the .net6 version RC2

* added editconfig.

* App core new Scoped Namespaces style.

* BlazorAdmin new Scoped Namespaces style.

* Blazor Shared new Scoped Namespaces style.

* Infra new Scoped Namespaces style.

* public api new Scoped Namespaces style.

* web new Scoped Namespaces style.

* FunctionalTests new Scoped Namespaces style.

* Integrational tests new Scoped Namespaces style.

* unit tests new Scoped Namespaces style.

* update github action.

* update github action.

* change the global.
This commit is contained in:
Shady Nagy
2021-11-06 01:55:48 +02:00
committed by GitHub
parent 64f150dc07
commit 9db2feb930
252 changed files with 6307 additions and 6413 deletions

View File

@@ -1,22 +1,21 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
{
public sealed class BasketWithItemsSpecification : Specification<Basket>, ISingleResultSpecification
{
public BasketWithItemsSpecification(int basketId)
{
Query
.Where(b => b.Id == basketId)
.Include(b => b.Items);
}
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public BasketWithItemsSpecification(string buyerId)
{
Query
.Where(b => b.BuyerId == buyerId)
.Include(b => b.Items);
}
public sealed class BasketWithItemsSpecification : Specification<Basket>, ISingleResultSpecification
{
public BasketWithItemsSpecification(int basketId)
{
Query
.Where(b => b.Id == basketId)
.Include(b => b.Items);
}
public BasketWithItemsSpecification(string buyerId)
{
Query
.Where(b => b.BuyerId == buyerId)
.Include(b => b.Items);
}
}

View File

@@ -1,21 +1,20 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public class CatalogFilterPaginatedSpecification : Specification<CatalogItem>
{
public class CatalogFilterPaginatedSpecification : Specification<CatalogItem>
public CatalogFilterPaginatedSpecification(int skip, int take, int? brandId, int? typeId)
: base()
{
public CatalogFilterPaginatedSpecification(int skip, int take, int? brandId, int? typeId)
: base()
if (take == 0)
{
if (take == 0)
{
take = int.MaxValue;
}
Query
.Where(i => (!brandId.HasValue || i.CatalogBrandId == brandId) &&
(!typeId.HasValue || i.CatalogTypeId == typeId))
.Skip(skip).Take(take);
take = int.MaxValue;
}
Query
.Where(i => (!brandId.HasValue || i.CatalogBrandId == brandId) &&
(!typeId.HasValue || i.CatalogTypeId == typeId))
.Skip(skip).Take(take);
}
}

View File

@@ -1,14 +1,13 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public class CatalogFilterSpecification : Specification<CatalogItem>
{
public class CatalogFilterSpecification : Specification<CatalogItem>
public CatalogFilterSpecification(int? brandId, int? typeId)
{
public CatalogFilterSpecification(int? brandId, int? typeId)
{
Query.Where(i => (!brandId.HasValue || i.CatalogBrandId == brandId) &&
(!typeId.HasValue || i.CatalogTypeId == typeId));
}
Query.Where(i => (!brandId.HasValue || i.CatalogBrandId == brandId) &&
(!typeId.HasValue || i.CatalogTypeId == typeId));
}
}

View File

@@ -1,13 +1,12 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public class CatalogItemNameSpecification : Specification<CatalogItem>
{
public class CatalogItemNameSpecification : Specification<CatalogItem>
public CatalogItemNameSpecification(string catalogItemName)
{
public CatalogItemNameSpecification(string catalogItemName)
{
Query.Where(item => catalogItemName == item.Name);
}
Query.Where(item => catalogItemName == item.Name);
}
}

View File

@@ -1,15 +1,14 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using System;
using System;
using System.Linq;
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public class CatalogItemsSpecification : Specification<CatalogItem>
{
public class CatalogItemsSpecification : Specification<CatalogItem>
public CatalogItemsSpecification(params int[] ids)
{
public CatalogItemsSpecification(params int[] ids)
{
Query.Where(c => ids.Contains(c.Id));
}
Query.Where(c => ids.Contains(c.Id));
}
}

View File

@@ -1,15 +1,14 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public class CustomerOrdersWithItemsSpecification : Specification<Order>
{
public class CustomerOrdersWithItemsSpecification : Specification<Order>
public CustomerOrdersWithItemsSpecification(string buyerId)
{
public CustomerOrdersWithItemsSpecification(string buyerId)
{
Query.Where(o => o.BuyerId == buyerId)
.Include(o => o.OrderItems)
.ThenInclude(i => i.ItemOrdered);
}
Query.Where(o => o.BuyerId == buyerId)
.Include(o => o.OrderItems)
.ThenInclude(i => i.ItemOrdered);
}
}

View File

@@ -1,16 +1,15 @@
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
public class OrderWithItemsByIdSpec : Specification<Order>, ISingleResultSpecification
{
public class OrderWithItemsByIdSpec : Specification<Order>, ISingleResultSpecification
public OrderWithItemsByIdSpec(int orderId)
{
public OrderWithItemsByIdSpec(int orderId)
{
Query
.Where(order => order.Id == orderId)
.Include(o => o.OrderItems)
.ThenInclude(i => i.ItemOrdered);
}
Query
.Where(order => order.Id == orderId)
.Include(o => o.OrderItems)
.ThenInclude(i => i.ItemOrdered);
}
}