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:
134
.editorconfig
Normal file
134
.editorconfig
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
###############################
|
||||||
|
# Core EditorConfig Options #
|
||||||
|
###############################
|
||||||
|
root = true
|
||||||
|
# All files
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
# XML project files
|
||||||
|
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# XML config files
|
||||||
|
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Code files
|
||||||
|
[*.{cs,csx,vb,vbx}]
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = true
|
||||||
|
charset = utf-8-bom
|
||||||
|
###############################
|
||||||
|
# .NET Coding Conventions #
|
||||||
|
###############################
|
||||||
|
[*.{cs,vb}]
|
||||||
|
# Organize usings
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
# this. preferences
|
||||||
|
dotnet_style_qualification_for_field = false:silent
|
||||||
|
dotnet_style_qualification_for_property = false:silent
|
||||||
|
dotnet_style_qualification_for_method = false:silent
|
||||||
|
dotnet_style_qualification_for_event = false:silent
|
||||||
|
# Language keywords vs BCL types preferences
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:silent
|
||||||
|
# Parentheses preferences
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||||
|
# Modifier preferences
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||||
|
dotnet_style_readonly_field = true:suggestion
|
||||||
|
# Expression-level preferences
|
||||||
|
dotnet_style_object_initializer = true:suggestion
|
||||||
|
dotnet_style_collection_initializer = true:suggestion
|
||||||
|
dotnet_style_explicit_tuple_names = true:suggestion
|
||||||
|
dotnet_style_null_propagation = true:suggestion
|
||||||
|
dotnet_style_coalesce_expression = true:suggestion
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||||
|
dotnet_style_prefer_auto_properties = true:silent
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||||
|
###############################
|
||||||
|
# Naming Conventions #
|
||||||
|
###############################
|
||||||
|
# Style Definitions
|
||||||
|
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||||
|
# Use PascalCase for constant fields
|
||||||
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
|
||||||
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
|
||||||
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
|
||||||
|
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
|
||||||
|
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
||||||
|
###############################
|
||||||
|
# C# Coding Conventions #
|
||||||
|
###############################
|
||||||
|
[*.cs]
|
||||||
|
# var preferences
|
||||||
|
csharp_style_var_for_built_in_types = true:silent
|
||||||
|
csharp_style_var_when_type_is_apparent = true:silent
|
||||||
|
csharp_style_var_elsewhere = true:silent
|
||||||
|
# Expression-bodied members
|
||||||
|
csharp_style_expression_bodied_methods = false:silent
|
||||||
|
csharp_style_expression_bodied_constructors = false:silent
|
||||||
|
csharp_style_expression_bodied_operators = false:silent
|
||||||
|
csharp_style_expression_bodied_properties = true:silent
|
||||||
|
csharp_style_expression_bodied_indexers = true:silent
|
||||||
|
csharp_style_expression_bodied_accessors = true:silent
|
||||||
|
# Pattern matching preferences
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||||
|
# Null-checking preferences
|
||||||
|
csharp_style_throw_expression = true:suggestion
|
||||||
|
csharp_style_conditional_delegate_call = true:suggestion
|
||||||
|
# Modifier preferences
|
||||||
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
|
||||||
|
# Expression-level preferences
|
||||||
|
csharp_prefer_braces = true:silent
|
||||||
|
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||||
|
csharp_prefer_simple_default_expression = true:suggestion
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true:suggestion
|
||||||
|
csharp_style_inlined_variable_declaration = true:suggestion
|
||||||
|
# Namespaces
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
###############################
|
||||||
|
# C# Formatting Rules #
|
||||||
|
###############################
|
||||||
|
# New line preferences
|
||||||
|
csharp_new_line_before_open_brace = all
|
||||||
|
csharp_new_line_before_else = true
|
||||||
|
csharp_new_line_before_catch = true
|
||||||
|
csharp_new_line_before_finally = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
# Indentation preferences
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
csharp_indent_labels = flush_left
|
||||||
|
# Space preferences
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
# Wrapping preferences
|
||||||
|
csharp_preserve_single_line_statements = true
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
###############################
|
||||||
|
# VB Coding Conventions #
|
||||||
|
###############################
|
||||||
|
[*.vb]
|
||||||
|
# Modifier preferences
|
||||||
|
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
|
||||||
3
.github/workflows/dotnetcore.yml
vendored
3
.github/workflows/dotnetcore.yml
vendored
@@ -12,7 +12,8 @@ jobs:
|
|||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: '5.0.x'
|
dotnet-version: '6.0.x'
|
||||||
|
include-prerelease: true
|
||||||
|
|
||||||
- name: Build with dotnet
|
- name: Build with dotnet
|
||||||
run: dotnet build ./eShopOnWeb.sln --configuration Release
|
run: dotnet build ./eShopOnWeb.sln --configuration Release
|
||||||
|
|||||||
6
global.json
Normal file
6
global.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "6.0.x",
|
||||||
|
"rollForward": "latestFeature"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<RootNamespace>Microsoft.eShopWeb.ApplicationCore</RootNamespace>
|
<RootNamespace>Microsoft.eShopWeb.ApplicationCore</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
namespace Microsoft.eShopWeb
|
namespace Microsoft.eShopWeb;
|
||||||
|
|
||||||
|
public class CatalogSettings
|
||||||
{
|
{
|
||||||
public class CatalogSettings
|
|
||||||
{
|
|
||||||
public string CatalogBaseUrl { get; set; }
|
public string CatalogBaseUrl { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Constants
|
namespace Microsoft.eShopWeb.ApplicationCore.Constants;
|
||||||
|
|
||||||
|
public class AuthorizationConstants
|
||||||
{
|
{
|
||||||
public class AuthorizationConstants
|
|
||||||
{
|
|
||||||
public const string AUTH_KEY = "AuthKeyOfDoomThatMustBeAMinimumNumberOfBytes";
|
public const string AUTH_KEY = "AuthKeyOfDoomThatMustBeAMinimumNumberOfBytes";
|
||||||
|
|
||||||
// TODO: Don't use this in production
|
// TODO: Don't use this in production
|
||||||
@@ -9,5 +9,4 @@
|
|||||||
|
|
||||||
// TODO: Change this to an environment variable
|
// TODO: Change this to an environment variable
|
||||||
public const string JWT_SECRET_KEY = "SecretKeyOfDoomThatMustBeAMinimumNumberOfBytes";
|
public const string JWT_SECRET_KEY = "SecretKeyOfDoomThatMustBeAMinimumNumberOfBytes";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
|
// This can easily be modified to be BaseEntity<T> and public T Id to support different key types.
|
||||||
|
// Using non-generic integer types for simplicity and to ease caching logic
|
||||||
|
public abstract class BaseEntity
|
||||||
{
|
{
|
||||||
// This can easily be modified to be BaseEntity<T> and public T Id to support different key types.
|
|
||||||
// Using non-generic integer types for simplicity and to ease caching logic
|
|
||||||
public abstract class BaseEntity
|
|
||||||
{
|
|
||||||
public virtual int Id { get; protected set; }
|
public virtual int Id { get; protected set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
|
||||||
|
public class Basket : BaseEntity, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class Basket : BaseEntity, IAggregateRoot
|
|
||||||
{
|
|
||||||
public string BuyerId { get; private set; }
|
public string BuyerId { get; private set; }
|
||||||
private readonly List<BasketItem> _items = new List<BasketItem>();
|
private readonly List<BasketItem> _items = new List<BasketItem>();
|
||||||
public IReadOnlyCollection<BasketItem> Items => _items.AsReadOnly();
|
public IReadOnlyCollection<BasketItem> Items => _items.AsReadOnly();
|
||||||
@@ -35,5 +35,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate
|
|||||||
{
|
{
|
||||||
BuyerId = buyerId;
|
BuyerId = buyerId;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Ardalis.GuardClauses;
|
using Ardalis.GuardClauses;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
|
||||||
|
public class BasketItem : BaseEntity
|
||||||
{
|
{
|
||||||
public class BasketItem : BaseEntity
|
|
||||||
{
|
|
||||||
|
|
||||||
public decimal UnitPrice { get; private set; }
|
public decimal UnitPrice { get; private set; }
|
||||||
public int Quantity { get; private set; }
|
public int Quantity { get; private set; }
|
||||||
@@ -30,5 +30,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate
|
|||||||
|
|
||||||
Quantity = quantity;
|
Quantity = quantity;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Ardalis.GuardClauses;
|
using System.Collections.Generic;
|
||||||
|
using Ardalis.GuardClauses;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BuyerAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BuyerAggregate;
|
||||||
|
|
||||||
|
public class Buyer : BaseEntity, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class Buyer : BaseEntity, IAggregateRoot
|
|
||||||
{
|
|
||||||
public string IdentityGuid { get; private set; }
|
public string IdentityGuid { get; private set; }
|
||||||
|
|
||||||
private List<PaymentMethod> _paymentMethods = new List<PaymentMethod>();
|
private List<PaymentMethod> _paymentMethods = new List<PaymentMethod>();
|
||||||
@@ -22,5 +22,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities.BuyerAggregate
|
|||||||
Guard.Against.NullOrEmpty(identity, nameof(identity));
|
Guard.Against.NullOrEmpty(identity, nameof(identity));
|
||||||
IdentityGuid = identity;
|
IdentityGuid = identity;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BuyerAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.BuyerAggregate;
|
||||||
|
|
||||||
|
public class PaymentMethod : BaseEntity
|
||||||
{
|
{
|
||||||
public class PaymentMethod : BaseEntity
|
|
||||||
{
|
|
||||||
public string Alias { get; private set; }
|
public string Alias { get; private set; }
|
||||||
public string CardId { get; private set; } // actual card data must be stored in a PCI compliant system, like Stripe
|
public string CardId { get; private set; } // actual card data must be stored in a PCI compliant system, like Stripe
|
||||||
public string Last4 { get; private set; }
|
public string Last4 { get; private set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
|
public class CatalogBrand : BaseEntity, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class CatalogBrand : BaseEntity, IAggregateRoot
|
|
||||||
{
|
|
||||||
public string Brand { get; private set; }
|
public string Brand { get; private set; }
|
||||||
public CatalogBrand(string brand)
|
public CatalogBrand(string brand)
|
||||||
{
|
{
|
||||||
Brand = brand;
|
Brand = brand;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Ardalis.GuardClauses;
|
using System;
|
||||||
|
using Ardalis.GuardClauses;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
|
public class CatalogItem : BaseEntity, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class CatalogItem : BaseEntity, IAggregateRoot
|
|
||||||
{
|
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public string Description { get; private set; }
|
public string Description { get; private set; }
|
||||||
public decimal Price { get; private set; }
|
public decimal Price { get; private set; }
|
||||||
@@ -62,5 +62,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities
|
|||||||
}
|
}
|
||||||
PictureUri = $"images\\products\\{pictureName}?{new DateTime().Ticks}";
|
PictureUri = $"images\\products\\{pictureName}?{new DateTime().Ticks}";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
|
public class CatalogType : BaseEntity, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class CatalogType : BaseEntity, IAggregateRoot
|
|
||||||
{
|
|
||||||
public string Type { get; private set; }
|
public string Type { get; private set; }
|
||||||
public CatalogType(string type)
|
public CatalogType(string type)
|
||||||
{
|
{
|
||||||
Type = type;
|
Type = type;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
|
public class Address // ValueObject
|
||||||
{
|
{
|
||||||
public class Address // ValueObject
|
|
||||||
{
|
|
||||||
public string Street { get; private set; }
|
public string Street { get; private set; }
|
||||||
|
|
||||||
public string City { get; private set; }
|
public string City { get; private set; }
|
||||||
@@ -22,5 +22,4 @@
|
|||||||
Country = country;
|
Country = country;
|
||||||
ZipCode = zipcode;
|
ZipCode = zipcode;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using Ardalis.GuardClauses;
|
using Ardalis.GuardClauses;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a snapshot of the item that was ordered. If catalog item details change, details of
|
||||||
|
/// the item that was part of a completed order should not change.
|
||||||
|
/// </summary>
|
||||||
|
public class CatalogItemOrdered // ValueObject
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Represents a snapshot of the item that was ordered. If catalog item details change, details of
|
|
||||||
/// the item that was part of a completed order should not change.
|
|
||||||
/// </summary>
|
|
||||||
public class CatalogItemOrdered // ValueObject
|
|
||||||
{
|
|
||||||
public CatalogItemOrdered(int catalogItemId, string productName, string pictureUri)
|
public CatalogItemOrdered(int catalogItemId, string productName, string pictureUri)
|
||||||
{
|
{
|
||||||
Guard.Against.OutOfRange(catalogItemId, nameof(catalogItemId), 1, int.MaxValue);
|
Guard.Against.OutOfRange(catalogItemId, nameof(catalogItemId), 1, int.MaxValue);
|
||||||
@@ -27,5 +27,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
|
|||||||
public int CatalogItemId { get; private set; }
|
public int CatalogItemId { get; private set; }
|
||||||
public string ProductName { get; private set; }
|
public string ProductName { get; private set; }
|
||||||
public string PictureUri { get; private set; }
|
public string PictureUri { get; private set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using Ardalis.GuardClauses;
|
using System;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Ardalis.GuardClauses;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
|
public class Order : BaseEntity, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class Order : BaseEntity, IAggregateRoot
|
|
||||||
{
|
|
||||||
private Order()
|
private Order()
|
||||||
{
|
{
|
||||||
// required by EF
|
// required by EF
|
||||||
@@ -48,5 +48,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
|
|||||||
}
|
}
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
|
namespace Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
|
public class OrderItem : BaseEntity
|
||||||
{
|
{
|
||||||
public class OrderItem : BaseEntity
|
|
||||||
{
|
|
||||||
public CatalogItemOrdered ItemOrdered { get; private set; }
|
public CatalogItemOrdered ItemOrdered { get; private set; }
|
||||||
public decimal UnitPrice { get; private set; }
|
public decimal UnitPrice { get; private set; }
|
||||||
public int Units { get; private set; }
|
public int Units { get; private set; }
|
||||||
@@ -17,5 +17,4 @@
|
|||||||
UnitPrice = unitPrice;
|
UnitPrice = unitPrice;
|
||||||
Units = units;
|
Units = units;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions
|
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions;
|
||||||
|
|
||||||
|
public class BasketNotFoundException : Exception
|
||||||
{
|
{
|
||||||
public class BasketNotFoundException : Exception
|
|
||||||
{
|
|
||||||
public BasketNotFoundException(int basketId) : base($"No basket found with id {basketId}")
|
public BasketNotFoundException(int basketId) : base($"No basket found with id {basketId}")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions
|
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions;
|
||||||
{
|
|
||||||
|
|
||||||
public class DuplicateException : Exception
|
public class DuplicateException : Exception
|
||||||
{
|
{
|
||||||
public DuplicateException(string message) : base(message)
|
public DuplicateException(string message) : base(message)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions
|
namespace Microsoft.eShopWeb.ApplicationCore.Exceptions;
|
||||||
|
|
||||||
|
public class EmptyBasketOnCheckoutException : Exception
|
||||||
{
|
{
|
||||||
public class EmptyBasketOnCheckoutException : Exception
|
|
||||||
{
|
|
||||||
public EmptyBasketOnCheckoutException()
|
public EmptyBasketOnCheckoutException()
|
||||||
: base($"Basket cannot have 0 items on checkout")
|
: base($"Basket cannot have 0 items on checkout")
|
||||||
{
|
{
|
||||||
@@ -20,5 +20,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Exceptions
|
|||||||
public EmptyBasketOnCheckoutException(string message, Exception innerException) : base(message, innerException)
|
public EmptyBasketOnCheckoutException(string message, Exception innerException) : base(message, innerException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using System.Collections.Generic;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Exceptions;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Exceptions;
|
||||||
|
|
||||||
namespace Ardalis.GuardClauses
|
namespace Ardalis.GuardClauses;
|
||||||
|
|
||||||
|
public static class BasketGuards
|
||||||
{
|
{
|
||||||
public static class BasketGuards
|
|
||||||
{
|
|
||||||
public static void NullBasket(this IGuardClause guardClause, int basketId, Basket basket)
|
public static void NullBasket(this IGuardClause guardClause, int basketId, Basket basket)
|
||||||
{
|
{
|
||||||
if (basket == null)
|
if (basket == null)
|
||||||
@@ -18,5 +18,4 @@ namespace Ardalis.GuardClauses
|
|||||||
if (!basketItems.Any())
|
if (!basketItems.Any())
|
||||||
throw new EmptyBasketOnCheckoutException();
|
throw new EmptyBasketOnCheckoutException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb
|
namespace Microsoft.eShopWeb;
|
||||||
|
|
||||||
|
public static class JsonExtensions
|
||||||
{
|
{
|
||||||
public static class JsonExtensions
|
|
||||||
{
|
|
||||||
private static readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions
|
private static readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions
|
||||||
{
|
{
|
||||||
PropertyNameCaseInsensitive = true
|
PropertyNameCaseInsensitive = true
|
||||||
@@ -14,5 +14,4 @@ namespace Microsoft.eShopWeb
|
|||||||
|
|
||||||
public static string ToJson<T>(this T obj) =>
|
public static string ToJson<T>(this T obj) =>
|
||||||
JsonSerializer.Serialize<T>(obj, _jsonOptions);
|
JsonSerializer.Serialize<T>(obj, _jsonOptions);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
{
|
|
||||||
public interface IAggregateRoot
|
public interface IAggregateRoot
|
||||||
{ }
|
{ }
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This type eliminates the need to depend directly on the ASP.NET Core logging types.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
public interface IAppLogger<T>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// This type eliminates the need to depend directly on the ASP.NET Core logging types.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
public interface IAppLogger<T>
|
|
||||||
{
|
|
||||||
void LogInformation(string message, params object[] args);
|
void LogInformation(string message, params object[] args);
|
||||||
void LogWarning(string message, params object[] args);
|
void LogWarning(string message, params object[] args);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface IBasketQueryService
|
||||||
{
|
{
|
||||||
public interface IBasketQueryService
|
|
||||||
{
|
|
||||||
Task<int> CountTotalBasketItems(string username);
|
Task<int> CountTotalBasketItems(string username);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface IBasketService
|
||||||
{
|
{
|
||||||
public interface IBasketService
|
|
||||||
{
|
|
||||||
Task TransferBasketAsync(string anonymousId, string userName);
|
Task TransferBasketAsync(string anonymousId, string userName);
|
||||||
Task<Basket> AddItemToBasket(string username, int catalogItemId, decimal price, int quantity = 1);
|
Task<Basket> AddItemToBasket(string username, int catalogItemId, decimal price, int quantity = 1);
|
||||||
Task<Basket> SetQuantities(int basketId, Dictionary<string, int> quantities);
|
Task<Basket> SetQuantities(int basketId, Dictionary<string, int> quantities);
|
||||||
Task DeleteBasketAsync(int basketId);
|
Task DeleteBasketAsync(int basketId);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IEmailSender
|
public interface IEmailSender
|
||||||
{
|
{
|
||||||
Task SendEmailAsync(string email, string subject, string message);
|
Task SendEmailAsync(string email, string subject, string message);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
using System.Threading.Tasks;
|
||||||
using System.Threading.Tasks;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface IOrderService
|
||||||
{
|
{
|
||||||
public interface IOrderService
|
|
||||||
{
|
|
||||||
Task CreateOrderAsync(int basketId, Address shippingAddress);
|
Task CreateOrderAsync(int basketId, Address shippingAddress);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface IReadRepository<T> : IReadRepositoryBase<T> where T : class, IAggregateRoot
|
||||||
{
|
{
|
||||||
public interface IReadRepository<T> : IReadRepositoryBase<T> where T : class, IAggregateRoot
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface IRepository<T> : IRepositoryBase<T> where T : class, IAggregateRoot
|
||||||
{
|
{
|
||||||
public interface IRepository<T> : IRepositoryBase<T> where T : class, IAggregateRoot
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface ITokenClaimsService
|
||||||
{
|
{
|
||||||
public interface ITokenClaimsService
|
|
||||||
{
|
|
||||||
Task<string> GetTokenAsync(string userName);
|
Task<string> GetTokenAsync(string userName);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
|
public interface IUriComposer
|
||||||
{
|
{
|
||||||
public interface IUriComposer
|
|
||||||
{
|
|
||||||
string ComposePicUri(string uriTemplate);
|
string ComposePicUri(string uriTemplate);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using Ardalis.GuardClauses;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Ardalis.GuardClauses;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Specifications;
|
using Microsoft.eShopWeb.ApplicationCore.Specifications;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Services
|
namespace Microsoft.eShopWeb.ApplicationCore.Services;
|
||||||
|
|
||||||
|
public class BasketService : IBasketService
|
||||||
{
|
{
|
||||||
public class BasketService : IBasketService
|
|
||||||
{
|
|
||||||
private readonly IRepository<Basket> _basketRepository;
|
private readonly IRepository<Basket> _basketRepository;
|
||||||
private readonly IAppLogger<BasketService> _logger;
|
private readonly IAppLogger<BasketService> _logger;
|
||||||
|
|
||||||
@@ -83,5 +83,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Services
|
|||||||
await _basketRepository.UpdateAsync(userBasket);
|
await _basketRepository.UpdateAsync(userBasket);
|
||||||
await _basketRepository.DeleteAsync(anonymousBasket);
|
await _basketRepository.DeleteAsync(anonymousBasket);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
using Ardalis.GuardClauses;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Ardalis.GuardClauses;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Specifications;
|
using Microsoft.eShopWeb.ApplicationCore.Specifications;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Services
|
namespace Microsoft.eShopWeb.ApplicationCore.Services;
|
||||||
|
|
||||||
|
public class OrderService : IOrderService
|
||||||
{
|
{
|
||||||
public class OrderService : IOrderService
|
|
||||||
{
|
|
||||||
private readonly IRepository<Order> _orderRepository;
|
private readonly IRepository<Order> _orderRepository;
|
||||||
private readonly IUriComposer _uriComposer;
|
private readonly IUriComposer _uriComposer;
|
||||||
private readonly IRepository<Basket> _basketRepository;
|
private readonly IRepository<Basket> _basketRepository;
|
||||||
@@ -50,5 +50,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Services
|
|||||||
|
|
||||||
await _orderRepository.AddAsync(order);
|
await _orderRepository.AddAsync(order);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Services
|
namespace Microsoft.eShopWeb.ApplicationCore.Services;
|
||||||
|
|
||||||
|
public class UriComposer : IUriComposer
|
||||||
{
|
{
|
||||||
public class UriComposer : IUriComposer
|
|
||||||
{
|
|
||||||
private readonly CatalogSettings _catalogSettings;
|
private readonly CatalogSettings _catalogSettings;
|
||||||
|
|
||||||
public UriComposer(CatalogSettings catalogSettings) => _catalogSettings = catalogSettings;
|
public UriComposer(CatalogSettings catalogSettings) => _catalogSettings = catalogSettings;
|
||||||
@@ -12,5 +12,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Services
|
|||||||
{
|
{
|
||||||
return uriTemplate.Replace("http://catalogbaseurltobereplaced", _catalogSettings.CatalogBaseUrl);
|
return uriTemplate.Replace("http://catalogbaseurltobereplaced", _catalogSettings.CatalogBaseUrl);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
|
namespace Microsoft.eShopWeb.ApplicationCore.Specifications;
|
||||||
|
|
||||||
|
public sealed class BasketWithItemsSpecification : Specification<Basket>, ISingleResultSpecification
|
||||||
{
|
{
|
||||||
public sealed class BasketWithItemsSpecification : Specification<Basket>, ISingleResultSpecification
|
|
||||||
{
|
|
||||||
public BasketWithItemsSpecification(int basketId)
|
public BasketWithItemsSpecification(int basketId)
|
||||||
{
|
{
|
||||||
Query
|
Query
|
||||||
@@ -18,5 +18,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Specifications
|
|||||||
.Where(b => b.BuyerId == buyerId)
|
.Where(b => b.BuyerId == buyerId)
|
||||||
.Include(b => b.Items);
|
.Include(b => b.Items);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
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)
|
public CatalogFilterPaginatedSpecification(int skip, int take, int? brandId, int? typeId)
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
@@ -17,5 +17,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Specifications
|
|||||||
(!typeId.HasValue || i.CatalogTypeId == typeId))
|
(!typeId.HasValue || i.CatalogTypeId == typeId))
|
||||||
.Skip(skip).Take(take);
|
.Skip(skip).Take(take);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
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) &&
|
Query.Where(i => (!brandId.HasValue || i.CatalogBrandId == brandId) &&
|
||||||
(!typeId.HasValue || i.CatalogTypeId == typeId));
|
(!typeId.HasValue || i.CatalogTypeId == typeId));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
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);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
using Ardalis.Specification;
|
using System;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
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));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
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)
|
Query.Where(o => o.BuyerId == buyerId)
|
||||||
.Include(o => o.OrderItems)
|
.Include(o => o.OrderItems)
|
||||||
.ThenInclude(i => i.ItemOrdered);
|
.ThenInclude(i => i.ItemOrdered);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Ardalis.Specification;
|
using Ardalis.Specification;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
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
|
Query
|
||||||
@@ -12,5 +12,4 @@ namespace Microsoft.eShopWeb.ApplicationCore.Specifications
|
|||||||
.Include(o => o.OrderItems)
|
.Include(o => o.OrderItems)
|
||||||
.ThenInclude(i => i.ItemOrdered);
|
.ThenInclude(i => i.ItemOrdered);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
using BlazorShared.Authorization;
|
using System;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BlazorShared.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace BlazorAdmin
|
namespace BlazorAdmin;
|
||||||
|
|
||||||
|
public class CustomAuthStateProvider : AuthenticationStateProvider
|
||||||
{
|
{
|
||||||
public class CustomAuthStateProvider : AuthenticationStateProvider
|
|
||||||
{
|
|
||||||
// TODO: Get Default Cache Duration from Config
|
// TODO: Get Default Cache Duration from Config
|
||||||
private static readonly TimeSpan UserCacheRefreshInterval = TimeSpan.FromSeconds(60);
|
private static readonly TimeSpan UserCacheRefreshInterval = TimeSpan.FromSeconds(60);
|
||||||
|
|
||||||
@@ -83,5 +83,4 @@ namespace BlazorAdmin
|
|||||||
|
|
||||||
return new ClaimsPrincipal(identity);
|
return new ClaimsPrincipal(identity);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace BlazorAdmin.Helpers
|
namespace BlazorAdmin.Helpers;
|
||||||
|
|
||||||
|
public class BlazorComponent : ComponentBase
|
||||||
{
|
{
|
||||||
public class BlazorComponent : ComponentBase
|
|
||||||
{
|
|
||||||
private readonly RefreshBroadcast _refresh = RefreshBroadcast.Instance;
|
private readonly RefreshBroadcast _refresh = RefreshBroadcast.Instance;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
@@ -22,5 +22,4 @@ namespace BlazorAdmin.Helpers
|
|||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace BlazorAdmin.Helpers
|
namespace BlazorAdmin.Helpers;
|
||||||
|
|
||||||
|
public class BlazorLayoutComponent : LayoutComponentBase
|
||||||
{
|
{
|
||||||
public class BlazorLayoutComponent : LayoutComponentBase
|
|
||||||
{
|
|
||||||
private readonly RefreshBroadcast _refresh = RefreshBroadcast.Instance;
|
private readonly RefreshBroadcast _refresh = RefreshBroadcast.Instance;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
@@ -21,5 +21,4 @@ namespace BlazorAdmin.Helpers
|
|||||||
{
|
{
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace BlazorAdmin.Helpers
|
namespace BlazorAdmin.Helpers;
|
||||||
|
|
||||||
|
internal sealed class RefreshBroadcast
|
||||||
{
|
{
|
||||||
internal sealed class RefreshBroadcast
|
|
||||||
{
|
|
||||||
private static readonly Lazy<RefreshBroadcast>
|
private static readonly Lazy<RefreshBroadcast>
|
||||||
Lazy =
|
Lazy =
|
||||||
new Lazy<RefreshBroadcast>
|
new Lazy<RefreshBroadcast>
|
||||||
@@ -20,5 +20,4 @@ namespace BlazorAdmin.Helpers
|
|||||||
{
|
{
|
||||||
RefreshRequested?.Invoke();
|
RefreshRequested?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using BlazorAdmin.Services;
|
using System;
|
||||||
|
using BlazorAdmin.Services;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace BlazorAdmin.Helpers
|
namespace BlazorAdmin.Helpers;
|
||||||
|
|
||||||
|
public class ToastComponent : ComponentBase, IDisposable
|
||||||
{
|
{
|
||||||
public class ToastComponent : ComponentBase, IDisposable
|
|
||||||
{
|
|
||||||
[Inject]
|
[Inject]
|
||||||
ToastService ToastService
|
ToastService ToastService
|
||||||
{
|
{
|
||||||
@@ -84,5 +84,4 @@ namespace BlazorAdmin.Helpers
|
|||||||
{
|
{
|
||||||
ToastService.OnShow -= ShowToast;
|
ToastService.OnShow -= ShowToast;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Microsoft.JSInterop;
|
using System.Threading.Tasks;
|
||||||
using System.Threading.Tasks;
|
using Microsoft.JSInterop;
|
||||||
|
|
||||||
namespace BlazorAdmin.JavaScript
|
namespace BlazorAdmin.JavaScript;
|
||||||
|
|
||||||
|
public class Cookies
|
||||||
{
|
{
|
||||||
public class Cookies
|
|
||||||
{
|
|
||||||
private readonly IJSRuntime _jsRuntime;
|
private readonly IJSRuntime _jsRuntime;
|
||||||
|
|
||||||
public Cookies(IJSRuntime jsRuntime)
|
public Cookies(IJSRuntime jsRuntime)
|
||||||
@@ -21,5 +21,4 @@ namespace BlazorAdmin.JavaScript
|
|||||||
{
|
{
|
||||||
return await _jsRuntime.InvokeAsync<string>(JSInteropConstants.GetCookie, name);
|
return await _jsRuntime.InvokeAsync<string>(JSInteropConstants.GetCookie, name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Microsoft.JSInterop;
|
using System.Threading.Tasks;
|
||||||
using System.Threading.Tasks;
|
using Microsoft.JSInterop;
|
||||||
|
|
||||||
namespace BlazorAdmin.JavaScript
|
namespace BlazorAdmin.JavaScript;
|
||||||
|
|
||||||
|
public class Css
|
||||||
{
|
{
|
||||||
public class Css
|
|
||||||
{
|
|
||||||
private readonly IJSRuntime _jsRuntime;
|
private readonly IJSRuntime _jsRuntime;
|
||||||
|
|
||||||
public Css(IJSRuntime jsRuntime)
|
public Css(IJSRuntime jsRuntime)
|
||||||
@@ -21,5 +21,4 @@ namespace BlazorAdmin.JavaScript
|
|||||||
{
|
{
|
||||||
return await _jsRuntime.InvokeAsync<string>(JSInteropConstants.HideBodyOverflow);
|
return await _jsRuntime.InvokeAsync<string>(JSInteropConstants.HideBodyOverflow);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
namespace BlazorAdmin.JavaScript
|
namespace BlazorAdmin.JavaScript;
|
||||||
|
|
||||||
|
public static class JSInteropConstants
|
||||||
{
|
{
|
||||||
public static class JSInteropConstants
|
|
||||||
{
|
|
||||||
public static string DeleteCookie => "deleteCookie";
|
public static string DeleteCookie => "deleteCookie";
|
||||||
public static string GetCookie => "getCookie";
|
public static string GetCookie => "getCookie";
|
||||||
public static string RouteOutside => "routeOutside";
|
public static string RouteOutside => "routeOutside";
|
||||||
public static string HideBodyOverflow => "hideBodyOverflow";
|
public static string HideBodyOverflow => "hideBodyOverflow";
|
||||||
public static string ShowBodyOverflow => "showBodyOverflow";
|
public static string ShowBodyOverflow => "showBodyOverflow";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Microsoft.JSInterop;
|
using System.Threading.Tasks;
|
||||||
using System.Threading.Tasks;
|
using Microsoft.JSInterop;
|
||||||
|
|
||||||
namespace BlazorAdmin.JavaScript
|
namespace BlazorAdmin.JavaScript;
|
||||||
|
|
||||||
|
public class Route
|
||||||
{
|
{
|
||||||
public class Route
|
|
||||||
{
|
|
||||||
private readonly IJSRuntime _jsRuntime;
|
private readonly IJSRuntime _jsRuntime;
|
||||||
|
|
||||||
public Route(IJSRuntime jsRuntime)
|
public Route(IJSRuntime jsRuntime)
|
||||||
@@ -16,5 +16,4 @@ namespace BlazorAdmin.JavaScript
|
|||||||
{
|
{
|
||||||
await _jsRuntime.InvokeAsync<string>(JSInteropConstants.RouteOutside, path);
|
await _jsRuntime.InvokeAsync<string>(JSInteropConstants.RouteOutside, path);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using BlazorAdmin.Helpers;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using BlazorAdmin.Helpers;
|
||||||
using BlazorShared.Interfaces;
|
using BlazorShared.Interfaces;
|
||||||
using BlazorShared.Models;
|
using BlazorShared.Models;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace BlazorAdmin.Pages.CatalogItemPage
|
namespace BlazorAdmin.Pages.CatalogItemPage;
|
||||||
|
|
||||||
|
public partial class List : BlazorComponent
|
||||||
{
|
{
|
||||||
public partial class List : BlazorComponent
|
|
||||||
{
|
|
||||||
[Microsoft.AspNetCore.Components.Inject]
|
[Microsoft.AspNetCore.Components.Inject]
|
||||||
public ICatalogItemService CatalogItemService { get; set; }
|
public ICatalogItemService CatalogItemService { get; set; }
|
||||||
|
|
||||||
@@ -65,5 +65,4 @@ namespace BlazorAdmin.Pages.CatalogItemPage
|
|||||||
catalogItems = await CatalogItemService.List();
|
catalogItems = await CatalogItemService.List();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using BlazorAdmin.Services;
|
using BlazorAdmin.Services;
|
||||||
using Blazored.LocalStorage;
|
using Blazored.LocalStorage;
|
||||||
using BlazorShared;
|
using BlazorShared;
|
||||||
@@ -7,14 +10,11 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace BlazorAdmin
|
namespace BlazorAdmin;
|
||||||
|
|
||||||
|
public class Program
|
||||||
{
|
{
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
public static async Task Main(string[] args)
|
public static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
@@ -52,5 +52,4 @@ namespace BlazorAdmin
|
|||||||
await localStorageService.RemoveItemAsync(typeof(CatalogBrand).Name);
|
await localStorageService.RemoveItemAsync(typeof(CatalogBrand).Name);
|
||||||
await localStorageService.RemoveItemAsync(typeof(CatalogType).Name);
|
await localStorageService.RemoveItemAsync(typeof(CatalogType).Name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
|
|
||||||
|
public class CacheEntry<T>
|
||||||
{
|
{
|
||||||
public class CacheEntry<T>
|
|
||||||
{
|
|
||||||
public CacheEntry(T item)
|
public CacheEntry(T item)
|
||||||
{
|
{
|
||||||
Value = item;
|
Value = item;
|
||||||
@@ -15,5 +15,4 @@ namespace BlazorAdmin.Services
|
|||||||
|
|
||||||
public T Value { get; set; }
|
public T Value { get; set; }
|
||||||
public DateTime DateCreated { get; set; } = DateTime.UtcNow;
|
public DateTime DateCreated { get; set; } = DateTime.UtcNow;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
using Blazored.LocalStorage;
|
using System;
|
||||||
using BlazorShared.Interfaces;
|
|
||||||
using BlazorShared.Models;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Blazored.LocalStorage;
|
||||||
|
using BlazorShared.Interfaces;
|
||||||
|
using BlazorShared.Models;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
|
|
||||||
|
public class CachedCatalogItemServiceDecorator : ICatalogItemService
|
||||||
{
|
{
|
||||||
public class CachedCatalogItemServiceDecorator : ICatalogItemService
|
|
||||||
{
|
|
||||||
private readonly ILocalStorageService _localStorageService;
|
private readonly ILocalStorageService _localStorageService;
|
||||||
private readonly CatalogItemService _catalogItemService;
|
private readonly CatalogItemService _catalogItemService;
|
||||||
private ILogger<CachedCatalogItemServiceDecorator> _logger;
|
private ILogger<CachedCatalogItemServiceDecorator> _logger;
|
||||||
@@ -110,5 +110,4 @@ namespace BlazorAdmin.Services
|
|||||||
var entry = new CacheEntry<List<CatalogItem>>(items);
|
var entry = new CacheEntry<List<CatalogItem>>(items);
|
||||||
await _localStorageService.SetItemAsync(key, entry);
|
await _localStorageService.SetItemAsync(key, entry);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
using Blazored.LocalStorage;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Blazored.LocalStorage;
|
||||||
using BlazorShared.Interfaces;
|
using BlazorShared.Interfaces;
|
||||||
using BlazorShared.Models;
|
using BlazorShared.Models;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
{
|
|
||||||
public class CachedCatalogLookupDataServiceDecorator<TLookupData, TReponse>
|
public class CachedCatalogLookupDataServiceDecorator<TLookupData, TReponse>
|
||||||
: ICatalogLookupDataService<TLookupData>
|
: ICatalogLookupDataService<TLookupData>
|
||||||
where TLookupData : LookupData
|
where TLookupData : LookupData
|
||||||
where TReponse : ILookupDataResponse<TLookupData>
|
where TReponse : ILookupDataResponse<TLookupData>
|
||||||
{
|
{
|
||||||
private readonly ILocalStorageService _localStorageService;
|
private readonly ILocalStorageService _localStorageService;
|
||||||
private readonly CatalogLookupDataService<TLookupData, TReponse> _catalogTypeService;
|
private readonly CatalogLookupDataService<TLookupData, TReponse> _catalogTypeService;
|
||||||
private ILogger<CachedCatalogLookupDataServiceDecorator<TLookupData, TReponse>> _logger;
|
private ILogger<CachedCatalogLookupDataServiceDecorator<TLookupData, TReponse>> _logger;
|
||||||
@@ -49,5 +49,4 @@ namespace BlazorAdmin.Services
|
|||||||
await _localStorageService.SetItemAsync(key, entry);
|
await _localStorageService.SetItemAsync(key, entry);
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
using BlazorShared.Interfaces;
|
using System.Collections.Generic;
|
||||||
using BlazorShared.Models;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BlazorShared.Interfaces;
|
||||||
|
using BlazorShared.Models;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
|
|
||||||
|
public class CatalogItemService : ICatalogItemService
|
||||||
{
|
{
|
||||||
public class CatalogItemService : ICatalogItemService
|
|
||||||
{
|
|
||||||
private readonly ICatalogLookupDataService<CatalogBrand> _brandService;
|
private readonly ICatalogLookupDataService<CatalogBrand> _brandService;
|
||||||
private readonly ICatalogLookupDataService<CatalogType> _typeService;
|
private readonly ICatalogLookupDataService<CatalogType> _typeService;
|
||||||
private readonly HttpService _httpService;
|
private readonly HttpService _httpService;
|
||||||
@@ -93,5 +93,4 @@ namespace BlazorAdmin.Services
|
|||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
using BlazorShared;
|
using System.Collections.Generic;
|
||||||
using BlazorShared.Attributes;
|
|
||||||
using BlazorShared.Interfaces;
|
|
||||||
using BlazorShared.Models;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BlazorShared;
|
||||||
|
using BlazorShared.Attributes;
|
||||||
|
using BlazorShared.Interfaces;
|
||||||
|
using BlazorShared.Models;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
{
|
|
||||||
public class CatalogLookupDataService<TLookupData, TReponse>
|
public class CatalogLookupDataService<TLookupData, TReponse>
|
||||||
: ICatalogLookupDataService<TLookupData>
|
: ICatalogLookupDataService<TLookupData>
|
||||||
where TLookupData : LookupData
|
where TLookupData : LookupData
|
||||||
where TReponse : ILookupDataResponse<TLookupData>
|
where TReponse : ILookupDataResponse<TLookupData>
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly HttpClient _httpClient;
|
private readonly HttpClient _httpClient;
|
||||||
private readonly ILogger<CatalogLookupDataService<TLookupData, TReponse>> _logger;
|
private readonly ILogger<CatalogLookupDataService<TLookupData, TReponse>> _logger;
|
||||||
@@ -39,5 +39,4 @@ namespace BlazorAdmin.Services
|
|||||||
var response = await _httpClient.GetFromJsonAsync<TReponse>($"{_apiUrl}{endpointName}");
|
var response = await _httpClient.GetFromJsonAsync<TReponse>($"{_apiUrl}{endpointName}");
|
||||||
return response.List;
|
return response.List;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using BlazorShared;
|
using System.Net.Http;
|
||||||
using BlazorShared.Models;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BlazorShared;
|
||||||
|
using BlazorShared.Models;
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
|
|
||||||
|
public class HttpService
|
||||||
{
|
{
|
||||||
public class HttpService
|
|
||||||
{
|
|
||||||
private readonly HttpClient _httpClient;
|
private readonly HttpClient _httpClient;
|
||||||
private readonly ToastService _toastService;
|
private readonly ToastService _toastService;
|
||||||
private readonly string _apiUrl;
|
private readonly string _apiUrl;
|
||||||
@@ -92,5 +92,4 @@ namespace BlazorAdmin.Services
|
|||||||
PropertyNameCaseInsensitive = true
|
PropertyNameCaseInsensitive = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
|
||||||
namespace BlazorAdmin.Services
|
namespace BlazorAdmin.Services;
|
||||||
|
|
||||||
|
public enum ToastLevel
|
||||||
{
|
{
|
||||||
public enum ToastLevel
|
|
||||||
{
|
|
||||||
Info,
|
Info,
|
||||||
Success,
|
Success,
|
||||||
Warning,
|
Warning,
|
||||||
Error
|
Error
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ToastService : IDisposable
|
public class ToastService : IDisposable
|
||||||
{
|
{
|
||||||
public event Action<string, ToastLevel> OnShow;
|
public event Action<string, ToastLevel> OnShow;
|
||||||
public event Action OnHide;
|
public event Action OnHide;
|
||||||
private Timer Countdown;
|
private Timer Countdown;
|
||||||
@@ -51,5 +51,4 @@ namespace BlazorAdmin.Services
|
|||||||
{
|
{
|
||||||
Countdown?.Dispose();
|
Countdown?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,19 @@ using BlazorShared.Interfaces;
|
|||||||
using BlazorShared.Models;
|
using BlazorShared.Models;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace BlazorAdmin
|
namespace BlazorAdmin;
|
||||||
|
|
||||||
|
public static class ServicesConfiguration
|
||||||
{
|
{
|
||||||
public static class ServicesConfiguration
|
|
||||||
{
|
|
||||||
public static IServiceCollection AddBlazorServices(this IServiceCollection services)
|
public static IServiceCollection AddBlazorServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddScoped<ICatalogLookupDataService<CatalogBrand>, CachedCatalogLookupDataServiceDecorator<CatalogBrand,CatalogBrandResponse>>();
|
services.AddScoped<ICatalogLookupDataService<CatalogBrand>, CachedCatalogLookupDataServiceDecorator<CatalogBrand, CatalogBrandResponse>>();
|
||||||
services.AddScoped<CatalogLookupDataService<CatalogBrand, CatalogBrandResponse>>();
|
services.AddScoped<CatalogLookupDataService<CatalogBrand, CatalogBrandResponse>>();
|
||||||
services.AddScoped<ICatalogLookupDataService<CatalogType>, CachedCatalogLookupDataServiceDecorator<CatalogType,CatalogTypeResponse>>();
|
services.AddScoped<ICatalogLookupDataService<CatalogType>, CachedCatalogLookupDataServiceDecorator<CatalogType, CatalogTypeResponse>>();
|
||||||
services.AddScoped<CatalogLookupDataService<CatalogType, CatalogTypeResponse>>();
|
services.AddScoped<CatalogLookupDataService<CatalogType, CatalogTypeResponse>>();
|
||||||
services.AddScoped<ICatalogItemService, CachedCatalogItemServiceDecorator>();
|
services.AddScoped<ICatalogItemService, CachedCatalogItemServiceDecorator>();
|
||||||
services.AddScoped<CatalogItemService>();
|
services.AddScoped<CatalogItemService>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using Microsoft.AspNetCore.Components.Forms;
|
using Microsoft.AspNetCore.Components.Forms;
|
||||||
|
|
||||||
namespace BlazorAdmin.Shared
|
namespace BlazorAdmin.Shared;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This is needed until 5.0 ships with native support
|
||||||
|
/// https://www.pragimtech.com/blog/blazor/inputselect-does-not-support-system.int32/
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TValue"></typeparam>
|
||||||
|
public class CustomInputSelect<TValue> : InputSelect<TValue>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// This is needed until 5.0 ships with native support
|
|
||||||
/// https://www.pragimtech.com/blog/blazor/inputselect-does-not-support-system.int32/
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="TValue"></typeparam>
|
|
||||||
public class CustomInputSelect<TValue> : InputSelect<TValue>
|
|
||||||
{
|
|
||||||
protected override bool TryParseValueFromString(string value, out TValue result,
|
protected override bool TryParseValueFromString(string value, out TValue result,
|
||||||
out string validationErrorMessage)
|
out string validationErrorMessage)
|
||||||
{
|
{
|
||||||
@@ -34,5 +34,4 @@ namespace BlazorAdmin.Shared
|
|||||||
out validationErrorMessage);
|
out validationErrorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace BlazorShared.Attributes
|
namespace BlazorShared.Attributes;
|
||||||
|
|
||||||
|
public class EndpointAttribute : Attribute
|
||||||
{
|
{
|
||||||
public class EndpointAttribute : Attribute
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace BlazorShared.Authorization
|
namespace BlazorShared.Authorization;
|
||||||
|
|
||||||
|
public class ClaimValue
|
||||||
{
|
{
|
||||||
public class ClaimValue
|
|
||||||
{
|
|
||||||
public ClaimValue()
|
public ClaimValue()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -14,5 +14,4 @@
|
|||||||
|
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
namespace BlazorShared.Authorization
|
namespace BlazorShared.Authorization;
|
||||||
|
|
||||||
|
public static class Constants
|
||||||
{
|
{
|
||||||
public static class Constants
|
|
||||||
{
|
|
||||||
public static class Roles
|
public static class Roles
|
||||||
{
|
{
|
||||||
public const string ADMINISTRATORS = "Administrators";
|
public const string ADMINISTRATORS = "Administrators";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace BlazorShared.Authorization
|
namespace BlazorShared.Authorization;
|
||||||
|
|
||||||
|
public class UserInfo
|
||||||
{
|
{
|
||||||
public class UserInfo
|
|
||||||
{
|
|
||||||
public static readonly UserInfo Anonymous = new UserInfo();
|
public static readonly UserInfo Anonymous = new UserInfo();
|
||||||
public bool IsAuthenticated { get; set; }
|
public bool IsAuthenticated { get; set; }
|
||||||
public string NameClaimType { get; set; }
|
public string NameClaimType { get; set; }
|
||||||
public string RoleClaimType { get; set; }
|
public string RoleClaimType { get; set; }
|
||||||
public string Token { get; set; }
|
public string Token { get; set; }
|
||||||
public IEnumerable<ClaimValue> Claims { get; set; }
|
public IEnumerable<ClaimValue> Claims { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
namespace BlazorShared
|
namespace BlazorShared;
|
||||||
|
|
||||||
|
public class BaseUrlConfiguration
|
||||||
{
|
{
|
||||||
public class BaseUrlConfiguration
|
|
||||||
{
|
|
||||||
public const string CONFIG_NAME = "baseUrls";
|
public const string CONFIG_NAME = "baseUrls";
|
||||||
|
|
||||||
public string ApiBase { get; set; }
|
public string ApiBase { get; set; }
|
||||||
public string WebBase { get; set; }
|
public string WebBase { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<RootNamespace>BlazorShared</RootNamespace>
|
<RootNamespace>BlazorShared</RootNamespace>
|
||||||
<AssemblyName>BlazorShared</AssemblyName>
|
<AssemblyName>BlazorShared</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -2,15 +2,14 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BlazorShared.Models;
|
using BlazorShared.Models;
|
||||||
|
|
||||||
namespace BlazorShared.Interfaces
|
namespace BlazorShared.Interfaces;
|
||||||
|
|
||||||
|
public interface ICatalogItemService
|
||||||
{
|
{
|
||||||
public interface ICatalogItemService
|
|
||||||
{
|
|
||||||
Task<CatalogItem> Create(CreateCatalogItemRequest catalogItem);
|
Task<CatalogItem> Create(CreateCatalogItemRequest catalogItem);
|
||||||
Task<CatalogItem> Edit(CatalogItem catalogItem);
|
Task<CatalogItem> Edit(CatalogItem catalogItem);
|
||||||
Task<string> Delete(int id);
|
Task<string> Delete(int id);
|
||||||
Task<CatalogItem> GetById(int id);
|
Task<CatalogItem> GetById(int id);
|
||||||
Task<List<CatalogItem>> ListPaged(int pageSize);
|
Task<List<CatalogItem>> ListPaged(int pageSize);
|
||||||
Task<List<CatalogItem>> List();
|
Task<List<CatalogItem>> List();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using BlazorShared.Models;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BlazorShared.Models;
|
||||||
|
|
||||||
namespace BlazorShared.Interfaces
|
namespace BlazorShared.Interfaces;
|
||||||
|
|
||||||
|
public interface ICatalogLookupDataService<TLookupData> where TLookupData : LookupData
|
||||||
{
|
{
|
||||||
public interface ICatalogLookupDataService<TLookupData> where TLookupData : LookupData
|
|
||||||
{
|
|
||||||
Task<List<TLookupData>> List();
|
Task<List<TLookupData>> List();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using BlazorShared.Models;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using BlazorShared.Models;
|
||||||
|
|
||||||
namespace BlazorShared.Interfaces
|
namespace BlazorShared.Interfaces;
|
||||||
|
|
||||||
|
public interface ILookupDataResponse<TLookupData> where TLookupData : LookupData
|
||||||
{
|
{
|
||||||
public interface ILookupDataResponse<TLookupData> where TLookupData : LookupData
|
|
||||||
{
|
|
||||||
List<TLookupData> List { get; set; }
|
List<TLookupData> List { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using BlazorShared.Attributes;
|
using BlazorShared.Attributes;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
[Endpoint(Name = "catalog-brands")]
|
||||||
|
public class CatalogBrand : LookupData
|
||||||
{
|
{
|
||||||
[Endpoint(Name = "catalog-brands")]
|
|
||||||
public class CatalogBrand : LookupData
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
using BlazorShared.Interfaces;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using BlazorShared.Interfaces;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class CatalogBrandResponse : ILookupDataResponse<CatalogBrand>
|
||||||
{
|
{
|
||||||
public class CatalogBrandResponse : ILookupDataResponse<CatalogBrand>
|
|
||||||
{
|
|
||||||
[JsonPropertyName("CatalogBrands")]
|
[JsonPropertyName("CatalogBrands")]
|
||||||
public List<CatalogBrand> List { get; set; } = new List<CatalogBrand>();
|
public List<CatalogBrand> List { get; set; } = new List<CatalogBrand>();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ using System.IO;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BlazorInputFile;
|
using BlazorInputFile;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class CatalogItem
|
||||||
{
|
{
|
||||||
public class CatalogItem
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
public int CatalogTypeId { get; set; }
|
public int CatalogTypeId { get; set; }
|
||||||
@@ -62,7 +62,7 @@ namespace BlazorShared.Models
|
|||||||
|
|
||||||
public static async Task<string> DataToBase64(IFileListEntry fileItem)
|
public static async Task<string> DataToBase64(IFileListEntry fileItem)
|
||||||
{
|
{
|
||||||
using ( var reader = new StreamReader(fileItem.Data))
|
using (var reader = new StreamReader(fileItem.Data))
|
||||||
{
|
{
|
||||||
using (var memStream = new MemoryStream())
|
using (var memStream = new MemoryStream())
|
||||||
{
|
{
|
||||||
@@ -84,5 +84,4 @@ namespace BlazorShared.Models
|
|||||||
string.Equals(extension, ".gif", StringComparison.OrdinalIgnoreCase) ||
|
string.Equals(extension, ".gif", StringComparison.OrdinalIgnoreCase) ||
|
||||||
string.Equals(extension, ".jpeg", StringComparison.OrdinalIgnoreCase);
|
string.Equals(extension, ".jpeg", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using BlazorShared.Attributes;
|
using BlazorShared.Attributes;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
[Endpoint(Name = "catalog-types")]
|
||||||
|
public class CatalogType : LookupData
|
||||||
{
|
{
|
||||||
[Endpoint(Name = "catalog-types")]
|
|
||||||
public class CatalogType : LookupData
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
using BlazorShared.Interfaces;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using BlazorShared.Interfaces;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class CatalogTypeResponse : ILookupDataResponse<CatalogType>
|
||||||
{
|
{
|
||||||
public class CatalogTypeResponse : ILookupDataResponse<CatalogType>
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonPropertyName("CatalogTypes")]
|
[JsonPropertyName("CatalogTypes")]
|
||||||
public List<CatalogType> List { get; set; } = new List<CatalogType>();
|
public List<CatalogType> List { get; set; } = new List<CatalogType>();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class CreateCatalogItemRequest
|
||||||
{
|
{
|
||||||
public class CreateCatalogItemRequest
|
|
||||||
{
|
|
||||||
public int CatalogTypeId { get; set; }
|
public int CatalogTypeId { get; set; }
|
||||||
|
|
||||||
public int CatalogBrandId { get; set; }
|
public int CatalogBrandId { get; set; }
|
||||||
@@ -24,5 +24,4 @@ namespace BlazorShared.Models
|
|||||||
public string PictureBase64 { get; set; } = string.Empty;
|
public string PictureBase64 { get; set; } = string.Empty;
|
||||||
public string PictureName { get; set; } = string.Empty;
|
public string PictureName { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class CreateCatalogItemResponse
|
||||||
{
|
{
|
||||||
public class CreateCatalogItemResponse
|
|
||||||
{
|
|
||||||
public CatalogItem CatalogItem { get; set; } = new CatalogItem();
|
public CatalogItem CatalogItem { get; set; } = new CatalogItem();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class DeleteCatalogItemResponse
|
||||||
{
|
{
|
||||||
public class DeleteCatalogItemResponse
|
|
||||||
{
|
|
||||||
public string Status { get; set; } = "Deleted";
|
public string Status { get; set; } = "Deleted";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class EditCatalogItemResult
|
||||||
{
|
{
|
||||||
public class EditCatalogItemResult
|
|
||||||
{
|
|
||||||
public CatalogItem CatalogItem { get; set; } = new CatalogItem();
|
public CatalogItem CatalogItem { get; set; } = new CatalogItem();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class ErrorDetails
|
||||||
{
|
{
|
||||||
public class ErrorDetails
|
|
||||||
{
|
|
||||||
public int StatusCode { get; set; }
|
public int StatusCode { get; set; }
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return JsonSerializer.Serialize(this);
|
return JsonSerializer.Serialize(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public abstract class LookupData
|
||||||
{
|
{
|
||||||
public abstract class LookupData
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace BlazorShared.Models
|
namespace BlazorShared.Models;
|
||||||
|
|
||||||
|
public class PagedCatalogItemResponse
|
||||||
{
|
{
|
||||||
public class PagedCatalogItemResponse
|
|
||||||
{
|
|
||||||
public List<CatalogItem> CatalogItems { get; set; } = new List<CatalogItem>();
|
public List<CatalogItem> CatalogItems { get; set; } = new List<CatalogItem>();
|
||||||
public int PageCount { get; set; } = 0;
|
public int PageCount { get; set; } = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using System.Linq;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data
|
namespace Microsoft.eShopWeb.Infrastructure.Data;
|
||||||
|
|
||||||
|
public class BasketQueryService : IBasketQueryService
|
||||||
{
|
{
|
||||||
public class BasketQueryService : IBasketQueryService
|
|
||||||
{
|
|
||||||
private readonly CatalogContext _dbContext;
|
private readonly CatalogContext _dbContext;
|
||||||
|
|
||||||
public BasketQueryService(CatalogContext dbContext)
|
public BasketQueryService(CatalogContext dbContext)
|
||||||
@@ -23,5 +23,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
|
|
||||||
return totalItems;
|
return totalItems;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using System.Reflection;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data
|
namespace Microsoft.eShopWeb.Infrastructure.Data;
|
||||||
|
|
||||||
|
public class CatalogContext : DbContext
|
||||||
{
|
{
|
||||||
|
|
||||||
public class CatalogContext : DbContext
|
|
||||||
{
|
|
||||||
public CatalogContext(DbContextOptions<CatalogContext> options) : base(options)
|
public CatalogContext(DbContextOptions<CatalogContext> options) : base(options)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -26,5 +25,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
base.OnModelCreating(builder);
|
base.OnModelCreating(builder);
|
||||||
builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
|
builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using System;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data
|
namespace Microsoft.eShopWeb.Infrastructure.Data;
|
||||||
|
|
||||||
|
public class CatalogContextSeed
|
||||||
{
|
{
|
||||||
public class CatalogContextSeed
|
|
||||||
{
|
|
||||||
public static async Task SeedAsync(CatalogContext catalogContext,
|
public static async Task SeedAsync(CatalogContext catalogContext,
|
||||||
ILoggerFactory loggerFactory, int retry = 0)
|
ILoggerFactory loggerFactory, int retry = 0)
|
||||||
{
|
{
|
||||||
@@ -97,5 +97,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
new(2,5, "Prism White TShirt", "Prism White TShirt", 12, "http://catalogbaseurltobereplaced/images/products/12.png")
|
new(2,5, "Prism White TShirt", "Prism White TShirt", 12, "http://catalogbaseurltobereplaced/images/products/12.png")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class BasketConfiguration : IEntityTypeConfiguration<Basket>
|
||||||
{
|
{
|
||||||
public class BasketConfiguration : IEntityTypeConfiguration<Basket>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<Basket> builder)
|
public void Configure(EntityTypeBuilder<Basket> builder)
|
||||||
{
|
{
|
||||||
var navigation = builder.Metadata.FindNavigation(nameof(Basket.Items));
|
var navigation = builder.Metadata.FindNavigation(nameof(Basket.Items));
|
||||||
@@ -15,5 +15,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(256);
|
.HasMaxLength(256);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,14 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class BasketItemConfiguration : IEntityTypeConfiguration<BasketItem>
|
||||||
{
|
{
|
||||||
public class BasketItemConfiguration : IEntityTypeConfiguration<BasketItem>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<BasketItem> builder)
|
public void Configure(EntityTypeBuilder<BasketItem> builder)
|
||||||
{
|
{
|
||||||
builder.Property(bi => bi.UnitPrice)
|
builder.Property(bi => bi.UnitPrice)
|
||||||
.IsRequired(true)
|
.IsRequired(true)
|
||||||
.HasColumnType("decimal(18,2)");
|
.HasColumnType("decimal(18,2)");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class CatalogBrandConfiguration : IEntityTypeConfiguration<CatalogBrand>
|
||||||
{
|
{
|
||||||
public class CatalogBrandConfiguration : IEntityTypeConfiguration<CatalogBrand>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<CatalogBrand> builder)
|
public void Configure(EntityTypeBuilder<CatalogBrand> builder)
|
||||||
{
|
{
|
||||||
builder.HasKey(ci => ci.Id);
|
builder.HasKey(ci => ci.Id);
|
||||||
@@ -18,5 +18,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(100);
|
.HasMaxLength(100);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class CatalogItemConfiguration : IEntityTypeConfiguration<CatalogItem>
|
||||||
{
|
{
|
||||||
public class CatalogItemConfiguration : IEntityTypeConfiguration<CatalogItem>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<CatalogItem> builder)
|
public void Configure(EntityTypeBuilder<CatalogItem> builder)
|
||||||
{
|
{
|
||||||
builder.ToTable("Catalog");
|
builder.ToTable("Catalog");
|
||||||
@@ -33,5 +33,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey(ci => ci.CatalogTypeId);
|
.HasForeignKey(ci => ci.CatalogTypeId);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class CatalogTypeConfiguration : IEntityTypeConfiguration<CatalogType>
|
||||||
{
|
{
|
||||||
public class CatalogTypeConfiguration : IEntityTypeConfiguration<CatalogType>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<CatalogType> builder)
|
public void Configure(EntityTypeBuilder<CatalogType> builder)
|
||||||
{
|
{
|
||||||
builder.HasKey(ci => ci.Id);
|
builder.HasKey(ci => ci.Id);
|
||||||
@@ -18,5 +18,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(100);
|
.HasMaxLength(100);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class OrderConfiguration : IEntityTypeConfiguration<Order>
|
||||||
{
|
{
|
||||||
public class OrderConfiguration : IEntityTypeConfiguration<Order>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<Order> builder)
|
public void Configure(EntityTypeBuilder<Order> builder)
|
||||||
{
|
{
|
||||||
var navigation = builder.Metadata.FindNavigation(nameof(Order.OrderItems));
|
var navigation = builder.Metadata.FindNavigation(nameof(Order.OrderItems));
|
||||||
@@ -40,5 +40,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Config;
|
||||||
|
|
||||||
|
public class OrderItemConfiguration : IEntityTypeConfiguration<OrderItem>
|
||||||
{
|
{
|
||||||
public class OrderItemConfiguration : IEntityTypeConfiguration<OrderItem>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<OrderItem> builder)
|
public void Configure(EntityTypeBuilder<OrderItem> builder)
|
||||||
{
|
{
|
||||||
builder.OwnsOne(i => i.ItemOrdered, io =>
|
builder.OwnsOne(i => i.ItemOrdered, io =>
|
||||||
@@ -21,5 +21,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Config
|
|||||||
.IsRequired(true)
|
.IsRequired(true)
|
||||||
.HasColumnType("decimal(18,2)");
|
.HasColumnType("decimal(18,2)");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
using Ardalis.Specification.EntityFrameworkCore;
|
using Ardalis.Specification.EntityFrameworkCore;
|
||||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data
|
namespace Microsoft.eShopWeb.Infrastructure.Data;
|
||||||
|
|
||||||
|
public class EfRepository<T> : RepositoryBase<T>, IReadRepository<T>, IRepository<T> where T : class, IAggregateRoot
|
||||||
{
|
{
|
||||||
public class EfRepository<T> : RepositoryBase<T>, IReadRepository<T>, IRepository<T> where T : class, IAggregateRoot
|
|
||||||
{
|
|
||||||
public EfRepository(CatalogContext dbContext) : base(dbContext)
|
public EfRepository(CatalogContext dbContext) : base(dbContext)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
namespace Microsoft.eShopWeb.Infrastructure.Data
|
namespace Microsoft.eShopWeb.Infrastructure.Data;
|
||||||
|
|
||||||
|
public class FileItem
|
||||||
{
|
{
|
||||||
public class FileItem
|
|
||||||
{
|
|
||||||
public string FileName { get; set; }
|
public string FileName { get; set; }
|
||||||
public string Url { get; set; }
|
public string Url { get; set; }
|
||||||
public long Size { get; set; }
|
public long Size { get; set; }
|
||||||
public string Ext { get; set; }
|
public string Ext { get; set; }
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
public string DataBase64 { get; set; }
|
public string DataBase64 { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations;
|
||||||
|
|
||||||
|
public partial class InitialModel : Migration
|
||||||
{
|
{
|
||||||
public partial class InitialModel : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.CreateSequence(
|
migrationBuilder.CreateSequence(
|
||||||
@@ -203,5 +203,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
|
|||||||
migrationBuilder.DropSequence(
|
migrationBuilder.DropSequence(
|
||||||
name: "catalog_type_hilo");
|
name: "catalog_type_hilo");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
|
namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations;
|
||||||
|
|
||||||
|
public partial class FixBuyerId : Migration
|
||||||
{
|
{
|
||||||
public partial class FixBuyerId : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.AlterColumn<string>(
|
migrationBuilder.AlterColumn<string>(
|
||||||
@@ -49,5 +49,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Data.Migrations
|
|||||||
oldType: "nvarchar(256)",
|
oldType: "nvarchar(256)",
|
||||||
oldMaxLength: 256);
|
oldMaxLength: 256);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
|
||||||
namespace Microsoft.eShopWeb.Infrastructure.Identity
|
namespace Microsoft.eShopWeb.Infrastructure.Identity;
|
||||||
|
|
||||||
|
public class AppIdentityDbContext : IdentityDbContext<ApplicationUser>
|
||||||
{
|
{
|
||||||
public class AppIdentityDbContext : IdentityDbContext<ApplicationUser>
|
|
||||||
{
|
|
||||||
public AppIdentityDbContext(DbContextOptions<AppIdentityDbContext> options)
|
public AppIdentityDbContext(DbContextOptions<AppIdentityDbContext> options)
|
||||||
: base(options)
|
: base(options)
|
||||||
{
|
{
|
||||||
@@ -18,6 +18,4 @@ namespace Microsoft.eShopWeb.Infrastructure.Identity
|
|||||||
// For example, you can rename the ASP.NET Identity table names and more.
|
// For example, you can rename the ASP.NET Identity table names and more.
|
||||||
// Add your customizations after calling base.OnModelCreating(builder);
|
// Add your customizations after calling base.OnModelCreating(builder);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user