├── .gitignore ├── Archive └── ECommerce │ ├── Controllers │ ├── AuthController.cs │ └── WeatherForecastController.cs │ ├── ECommerce.csproj │ ├── Model │ ├── Auth.cs │ ├── IJwtAuth.cs │ └── LoginVM.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── AuditLogEFPlus ├── AuditLog.API │ ├── AuditLog.API.csproj │ ├── Controllers │ │ ├── CustomersController.cs │ │ └── ReportingController.cs │ ├── Migrations │ │ ├── 20240113215834_inital-mig.Designer.cs │ │ ├── 20240113215834_inital-mig.cs │ │ └── AuditLogDBContextModelSnapshot.cs │ ├── Models │ │ ├── CustomAuditEntry.cs │ │ ├── CustomAuditEntryProperty.cs │ │ └── Customer.cs │ ├── Persistence │ │ └── AuditLogDBContext.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Repositories │ │ ├── Implementations │ │ │ ├── CustomerRepository.cs │ │ │ └── ReportingRepository.cs │ │ └── Interfaces │ │ │ ├── ICustomerRepository.cs │ │ │ └── IReportingRepositry.cs │ ├── Services │ │ ├── Implementations │ │ │ ├── CustomerService.cs │ │ │ └── ReportingService.cs │ │ └── Interfaces │ │ │ ├── ICustomerService.cs │ │ │ └── IReportingService.cs │ ├── appsettings.Development.json │ └── appsettings.json └── EFPlusAuditLog.sln ├── AuditLogRawSQL ├── AuditLog.API │ ├── AuditLog.API.csproj │ ├── AuditTrail │ │ ├── Enums │ │ │ ├── ApplicationEnum.cs │ │ │ ├── EnumExtensions.cs │ │ │ └── StateName.cs │ │ ├── Implementations │ │ │ └── AuditTrail.cs │ │ └── Interfaces │ │ │ └── IAuditTrail.cs │ ├── Controllers │ │ ├── ProductsController.cs │ │ └── ReportingController.cs │ ├── Models │ │ └── Product.cs │ ├── Persistence │ │ └── DBConnector.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Repositories │ │ ├── Implementations │ │ │ ├── ProductRepository.cs │ │ │ └── ReportingRepository.cs │ │ └── Interfaces │ │ │ ├── IProductRepository.cs │ │ │ └── IReportingRepository.cs │ ├── Services │ │ ├── Implementations │ │ │ ├── ProductService.cs │ │ │ └── ReportingService.cs │ │ └── Interfaces │ │ │ ├── IProductService.cs │ │ │ └── IReportingService.cs │ ├── appsettings.Development.json │ └── appsettings.json └── AuditTrail.sln ├── CacheRefreshFunction ├── CacheRefreshAzureFunction │ ├── .gitignore │ ├── CacheRefreshAzureFunction.csproj │ ├── CacheRefreshTimerTriggerFunction.cs │ ├── Program.cs │ ├── Properties │ │ ├── PublishProfiles │ │ │ └── CacheRefreshAzureFunction198412 - Zip Deploy.pubxml │ │ ├── ServiceDependencies │ │ │ └── CacheRefreshAzureFunction198412 - Zip Deploy │ │ │ │ ├── appInsights1.arm.json │ │ │ │ ├── profile.arm.json │ │ │ │ └── storage1.arm.json │ │ ├── launchSettings.json │ │ ├── serviceDependencies.CacheRefreshAzureFunction198412 - Zip Deploy.json │ │ ├── serviceDependencies.json │ │ └── serviceDependencies.local.json │ └── host.json └── CacheRefreshFunction.sln ├── CleanArchitectureDemo └── Ecommerce │ ├── Ecommerce.sln │ └── Services │ └── Ordering │ ├── Ordering.API │ ├── Controllers │ │ └── CustomerController.cs │ ├── Db │ │ └── Ordering.db │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Ordering.Application │ ├── Commands │ │ ├── CreateCustomerCommand.cs │ │ ├── DeleteCustomerCommand.cs │ │ └── EditCustomerCommand.cs │ ├── Handlers │ │ ├── CommandHandler │ │ │ ├── CreateCustomerHandler.cs │ │ │ ├── DeleteCustomerHandler.cs │ │ │ └── EditCustomerHandler.cs │ │ └── QueryHandlers │ │ │ ├── GetAllCustomerHandler.cs │ │ │ ├── GetCustomerByEmailHandler.cs │ │ │ └── GetCustomerByIdHandler.cs │ ├── Mapper │ │ ├── CustomerMapper.cs │ │ └── OrderingMappingProfile.cs │ ├── Ordering.Application.csproj │ ├── Queries │ │ ├── GetAllCustomerQuery.cs │ │ ├── GetCustomerByEmailQuery.cs │ │ └── GetCustomerByIdQuery.cs │ └── Response │ │ └── CustomerResponse.cs │ ├── Ordering.Core │ ├── Entities │ │ ├── Base │ │ │ └── BaseEntity.cs │ │ └── Customer.cs │ ├── Ordering.Core.csproj │ └── Repositories │ │ ├── Command │ │ ├── Base │ │ │ └── ICommandRepository.cs │ │ └── ICustomerCommandRepository.cs │ │ └── Query │ │ ├── Base │ │ └── IQueryRepository.cs │ │ └── ICustomerQueryRepository.cs │ └── Ordering.Infrastructure │ ├── Data │ ├── DbConnector.cs │ └── OrderingContext.cs │ ├── Migrations │ ├── 20210917021017_initialsqlmig.Designer.cs │ ├── 20210917021017_initialsqlmig.cs │ └── OrderingContextModelSnapshot.cs │ ├── Ordering.Infrastructure.csproj │ └── Repository │ ├── Command │ ├── Base │ │ └── CommandRepository.cs │ └── CustomerCommandRepository.cs │ └── Query │ ├── Base │ └── QueryRepository.cs │ └── CustomerQueryRepository.cs ├── CleanArchitectureTemplate ├── CleanArchitecture │ ├── .template.config │ │ └── template.json │ ├── CleanArch.API │ │ ├── CleanArch.API.csproj │ │ ├── Controllers │ │ │ └── HomesController.cs │ │ ├── Filters │ │ │ ├── ApiExceptionFilterAttribute.cs │ │ │ └── AuthorizeCheckOperationFilter.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Services │ │ │ └── CurrentUserService.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── CleanArch.Application │ │ ├── CleanArch.Application.csproj │ │ ├── Commands │ │ │ └── Class1.cs │ │ ├── Common │ │ │ ├── Behaviours │ │ │ │ ├── AuthorizationBehaviour.cs │ │ │ │ ├── UnhandledExceptionBehaviour.cs │ │ │ │ └── ValidationBehaviour.cs │ │ │ ├── Exceptions │ │ │ │ ├── BadRequestException.cs │ │ │ │ ├── ForbiddenAccessException.cs │ │ │ │ ├── NotFoundException.cs │ │ │ │ └── ValidationException.cs │ │ │ ├── Interfaces │ │ │ │ ├── ICurrentUserService.cs │ │ │ │ └── Repositories │ │ │ │ │ ├── Command │ │ │ │ │ └── Base │ │ │ │ │ │ └── ICommandRepository.cs │ │ │ │ │ ├── IUnitOfWork.cs │ │ │ │ │ └── Query │ │ │ │ │ └── Base │ │ │ │ │ └── IQueryRepository.cs │ │ │ └── Mappings │ │ │ │ └── MappingProfile.cs │ │ ├── DTOs │ │ │ └── Class1.cs │ │ ├── DependencyInjection.cs │ │ └── Queries │ │ │ └── Class1.cs │ ├── CleanArch.Core │ │ ├── CleanArch.Core.csproj │ │ ├── Entities │ │ │ └── Base │ │ │ │ └── BaseEntity.cs │ │ └── Models │ │ │ └── IdentityServerConfiguration.cs │ ├── CleanArch.Infrastructure │ │ ├── CleanArch.Infrastructure.csproj │ │ ├── Configs │ │ │ ├── ConfigurationSettings.cs │ │ │ └── ConnectionStrings.cs │ │ ├── DependencyInjection.cs │ │ ├── Persistence │ │ │ ├── ApplicationDbContext.cs │ │ │ ├── DbConnector.cs │ │ │ ├── DbFactory.cs │ │ │ └── EfConfiguration │ │ │ │ └── BaseTypeConfiguration.cs │ │ └── Repository │ │ │ ├── Command │ │ │ └── Base │ │ │ │ └── CommandRepository.cs │ │ │ ├── Query │ │ │ └── Base │ │ │ │ └── QueryRepository.cs │ │ │ └── UnitOfWork.cs │ └── CleanArchTemplate.sln └── TemplatePack.csproj ├── ConcurrencyAppToken ├── ConcurrencyHandling.API │ ├── ConcurrencyHandling.API.csproj │ ├── Controllers │ │ └── BookingsController.cs │ ├── Data │ │ └── ApplicationDbContext.cs │ ├── Migrations │ │ ├── 20240117181227_initial-mig.Designer.cs │ │ ├── 20240117181227_initial-mig.cs │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Models │ │ └── Booking.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json └── ConcurrencyHandling.sln ├── ConcurrencyDBToken ├── ConcurrencyHandling.API │ ├── ConcurrencyHandling.API.csproj │ ├── Controllers │ │ └── AccountsController.cs │ ├── Data │ │ └── ApplicationDbContext.cs │ ├── Migrations │ │ ├── 20240117173349_initial-mig.Designer.cs │ │ ├── 20240117173349_initial-mig.cs │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Models │ │ └── Account.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json └── ConcurrencyHandling.sln ├── ConcurrencyEtags ├── ConcurrencyHandling.API │ ├── ConcurrencyHandling.API.csproj │ ├── Controllers │ │ └── ProductsController.cs │ ├── Data │ │ └── ApplicationDbContext.cs │ ├── Migrations │ │ ├── 20240117182203_initial-mig.Designer.cs │ │ ├── 20240117182203_initial-mig.cs │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Models │ │ └── Product.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json └── ConcurrencyHandling.sln ├── ConcurrencyHyperMedia ├── ConcurrencyHandling.API │ ├── ConcurrencyHandling.API.csproj │ ├── Controllers │ │ └── EmployeesController.cs │ ├── Data │ │ └── ApplicationDbContext.cs │ ├── Migrations │ │ ├── 20240117181920_intial-mig.Designer.cs │ │ ├── 20240117181920_intial-mig.cs │ │ └── ApplicationDbContextModelSnapshot.cs │ ├── Models │ │ └── Employee.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json └── ConcurrencyHandling.sln ├── ConcurrencyRawSQL ├── Concurrency.API │ ├── Concurrency.API.csproj │ ├── Controllers │ │ └── ProductsController.cs │ ├── Models │ │ └── Product.cs │ ├── Persistence │ │ └── DBConnector.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Repositories │ │ ├── Implementations │ │ │ └── ProductRepository.cs │ │ └── Interfaces │ │ │ └── IProductRepository.cs │ ├── Services │ │ ├── Implementations │ │ │ └── ProductService.cs │ │ └── Interfaces │ │ │ └── IProductService.cs │ ├── appsettings.Development.json │ └── appsettings.json └── Concurrency.sln ├── DapperDemo ├── DapperDemo │ ├── Customer.API │ │ ├── Controllers │ │ │ └── CustomerController.cs │ │ ├── Entities │ │ │ ├── BaseEntity.cs │ │ │ └── Customer.cs │ │ ├── Ordering.API.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Repositories │ │ │ ├── CustomerRepository.cs │ │ │ ├── DbConnector.cs │ │ │ ├── ICustomerRepository.cs │ │ │ └── IGenericRepository.cs │ │ ├── Services │ │ │ ├── CustomerService.cs │ │ │ └── ICustomerService.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ └── DapperDemo.sln └── Utility │ └── scripts.sql ├── ECommerceFacade ├── ECommerceFacade.sln └── ECommerceFacade │ ├── ECommerceFacade.csproj │ └── Program.cs ├── EFBulkBatch ├── EFBulkBatch.sln └── EFBulkBatch │ ├── Controllers │ ├── CustomerController.cs │ ├── EmployeeController.cs │ └── WeatherForecastController.cs │ ├── Db │ └── ApplicationDbContext.cs │ ├── EFBulkBatch.csproj │ ├── Managers │ ├── CustomerService.cs │ └── EmployeeService.cs │ ├── Migrations │ ├── 20231120165730_initial-mig.Designer.cs │ ├── 20231120165730_initial-mig.cs │ ├── 20231120193817_add-customer.Designer.cs │ ├── 20231120193817_add-customer.cs │ └── ApplicationDbContextModelSnapshot.cs │ ├── Models │ ├── Customer.cs │ └── Employee.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── EventSourcing ├── Application │ ├── Application.csproj │ ├── Commands │ │ └── CatalogItems │ │ │ ├── CreateCatalogItemCommand.cs │ │ │ ├── DeleteCatalogItemCommand.cs │ │ │ └── UpdateCatalogItemCommand.cs │ ├── Common │ │ ├── DTOs │ │ │ ├── CreateCatalogItemDTO.cs │ │ │ └── UpdateCatalogItemDTO.cs │ │ ├── Interfaces │ │ │ ├── IAggregateRepository.cs │ │ │ ├── ICatalogItemAggregateRepository_old.cs │ │ │ └── ICatalogItemRepository.cs │ │ └── Resolvers │ │ │ └── PrivateSetterContractResolver.cs │ ├── DependencyInjection.cs │ └── Queries │ │ └── CatalogItems │ │ └── GetCatalogItemLogByIdQuery.cs ├── Catalog.API │ ├── Catalog.API.csproj │ ├── Controllers │ │ └── CatalogItemController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ └── appsettings.json ├── Domain │ ├── Domain.csproj │ ├── Entities │ │ ├── CatalogItem.cs │ │ └── Common │ │ │ ├── BaseAggregateRoot.cs │ │ │ ├── BaseDomainEvent.cs │ │ │ ├── BaseEntity.cs │ │ │ ├── IAggregateRoot.cs │ │ │ ├── IBaseEntity.cs │ │ │ └── IDomainEvent.cs │ └── Events │ │ └── CatalogItem │ │ ├── CatalogItemCreated.cs │ │ ├── CatalogItemDeleted.cs │ │ └── CatalogItemUpdated.cs ├── EventSourcing.sln └── Infrastructure │ ├── DependencyInjection.cs │ ├── Infrastructure.csproj │ ├── Migrations │ ├── 20220705100221_change-id-to-guid.Designer.cs │ ├── 20220705100221_change-id-to-guid.cs │ ├── 20220707101928_add-column.Designer.cs │ ├── 20220707101928_add-column.cs │ └── ApplicationDbContextModelSnapshot.cs │ └── Persistance │ ├── AggregateRepository.cs │ ├── ApplicationDbContext.cs │ ├── CatalogItemAggregateRepository_old.cs │ └── CatalogItemRepository.cs ├── FacadePattern └── FacadePattern │ ├── FacadePattern.sln │ └── FacadePattern │ ├── FacadePattern.csproj │ └── Program.cs ├── IValidatebleObject ├── IValidatebleObjectDemo │ ├── Employee.cs │ ├── IValidatebleObjectDemo.csproj │ └── Program.cs └── IValidatebleObjectSln.sln ├── IdempotentDemo ├── Accounting.API │ ├── Accounting.API.csproj │ ├── Controllers │ │ └── TransactionDetailsController.cs │ ├── Db │ │ └── AccountingContext.cs │ ├── Migrations │ │ ├── 20220823082321_initial-mig.Designer.cs │ │ ├── 20220823082321_initial-mig.cs │ │ └── AccountingContextModelSnapshot.cs │ ├── Models │ │ └── TransactionDetails.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Utility │ │ └── HashGenerator.cs │ ├── appsettings.Development.json │ └── appsettings.json └── IdempotentDemo.sln ├── LICENSE ├── MultiTenant ├── MTShop.API │ ├── Controllers │ │ ├── AuthController.cs │ │ ├── CustomerController.cs │ │ ├── ProductsController.cs │ │ ├── RoleController.cs │ │ ├── TenantController.cs │ │ └── UserController.cs │ ├── MTShop.API.csproj │ ├── Middlewares │ │ └── ExceptionHandlingMiddleware.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── seed.authdata.json │ └── tenantsettings.json ├── MTShop.Application │ ├── Commands │ │ ├── Auth │ │ │ ├── AdminAuthCommand.cs │ │ │ └── AuthCommand.cs │ │ ├── Customer │ │ │ └── CustomerCreatedCommand.cs │ │ ├── Products │ │ │ └── ProductCreatedCommand.cs │ │ ├── Role │ │ │ ├── RoleCreateCommand.cs │ │ │ ├── RoleDeleteCommand.cs │ │ │ └── RoleUpdateCommand.cs │ │ ├── Tenant │ │ │ ├── TenantCreateCommand.cs │ │ │ ├── TenantDeleteCommand.cs │ │ │ └── TenantUpdateCommand.cs │ │ └── User │ │ │ ├── UserCreateCommand.cs │ │ │ ├── UserDeleteCommand.cs │ │ │ └── UserUpdateCommand.cs │ ├── Common │ │ ├── Constants │ │ │ ├── IdentityTableConstants.cs │ │ │ └── UserRolesConstants.cs │ │ ├── Exceptions │ │ │ ├── BadRequestException.cs │ │ │ ├── IdentityResultException.cs │ │ │ ├── NotFoundException.cs │ │ │ └── ValidationException.cs │ │ ├── Mappings │ │ │ ├── AdminMappingProfile.cs │ │ │ ├── CustomerMappingProfile.cs │ │ │ ├── ProductMappingProfile.cs │ │ │ ├── RoleMappingProfile.cs │ │ │ └── UserMappingProfile.cs │ │ ├── Models │ │ │ ├── ErrorDetails.cs │ │ │ ├── TenantsSeed.cs │ │ │ └── UserConfiguration.cs │ │ └── Settings │ │ │ ├── DBConfiguration.cs │ │ │ ├── Tenant.cs │ │ │ └── TenantSettings.cs │ ├── DTOs │ │ ├── AuthResponseDTO.cs │ │ ├── CustomerDTO.cs │ │ ├── ProductDTO.cs │ │ ├── RoleDto.cs │ │ ├── TenantDTO.cs │ │ ├── UserDTO.cs │ │ └── UserResponseDTO.cs │ ├── DependencyInjection.cs │ ├── IMultitenantDbContextInitializer.cs │ ├── Interfaces │ │ ├── Admin │ │ │ ├── IAdminIdentityService.cs │ │ │ └── IManageTenantRepository.cs │ │ ├── IAdminUnitOfWork.cs │ │ ├── ICurrentUserService.cs │ │ ├── IIdentityService.cs │ │ ├── ITenantService.cs │ │ ├── IUnitOfWork.cs │ │ └── Repositories │ │ │ ├── ICustomerRepository.cs │ │ │ └── IProductRepository.cs │ ├── MTShop.Application.csproj │ └── Queries │ │ ├── Customer │ │ ├── CustomerQuery.cs │ │ └── CustomerQueryById.cs │ │ ├── Products │ │ ├── ProductQuery.cs │ │ └── ProductQueryById.cs │ │ ├── Role │ │ ├── RoleByIdQuery.cs │ │ └── RolesQuery.cs │ │ ├── Tenant │ │ ├── TenantByIdQuery.cs │ │ └── TenantQuery.cs │ │ └── User │ │ └── UsersQuery.cs ├── MTShop.Core │ ├── Contracts │ │ └── IMustHaveTenant.cs │ ├── Entities │ │ ├── Admin │ │ │ ├── Identity │ │ │ │ ├── AdminApplicationRole.cs │ │ │ │ ├── AdminApplicationUser.cs │ │ │ │ ├── AdminApplicationUserClaim.cs │ │ │ │ ├── AdminApplicationUserLogin.cs │ │ │ │ ├── AdminApplicationUserRole.cs │ │ │ │ ├── AdminApplicationUserRoleClaim.cs │ │ │ │ └── AdminApplicationUserToken.cs │ │ │ └── TenantEntity.cs │ │ ├── Base │ │ │ └── BaseEntity.cs │ │ ├── Customer.cs │ │ ├── Identity │ │ │ ├── ApplicationRole.cs │ │ │ ├── ApplicationUser.cs │ │ │ ├── ApplicationUserClaim.cs │ │ │ ├── ApplicationUserLogin.cs │ │ │ ├── ApplicationUserRole.cs │ │ │ ├── ApplicationUserRoleClaim.cs │ │ │ └── ApplicationUserToken.cs │ │ └── Product.cs │ └── MTShop.Core.csproj ├── MTShop.Infrastructure │ ├── Extensions │ │ └── ServiceCollectionExtensions.cs │ ├── Implementations │ │ ├── Admin │ │ │ └── ManageTenantRepository.cs │ │ ├── AdminIdentityService.cs │ │ ├── CurrentUserService.cs │ │ ├── IdentityService.cs │ │ ├── Repositories │ │ │ ├── CustomerRepository.cs │ │ │ └── ProductRepository.cs │ │ └── TenantService.cs │ ├── MTShop.Infrastructure.csproj │ ├── Migrations │ │ ├── 20221101111645_initialmig.Designer.cs │ │ ├── 20221101111645_initialmig.cs │ │ ├── Admin │ │ │ ├── 20221026062759_initial-mig.Designer.cs │ │ │ ├── 20221026062759_initial-mig.cs │ │ │ └── AdminDbContextModelSnapshot.cs │ │ └── MultitenantDbContextModelSnapshot.cs │ ├── Persistence │ │ ├── Admin │ │ │ ├── AdminDbContext.cs │ │ │ └── Configuration │ │ │ │ ├── AdminApplicationRoleConfiguration.cs │ │ │ │ ├── AdminApplicationUserClaimConfiguration.cs │ │ │ │ ├── AdminApplicationUserConfiguration.cs │ │ │ │ ├── AdminApplicationUserLoginConfiguration.cs │ │ │ │ ├── AdminApplicationUserRoleClaimConfiguration.cs │ │ │ │ ├── AdminApplicationUserRoleConfiguration.cs │ │ │ │ └── AdminApplicationUserTokenConfiguration.cs │ │ ├── AdminUnitOfWork.cs │ │ ├── Configuration │ │ │ ├── ApplicationRoleConfiguration.cs │ │ │ ├── ApplicationUserClaimConfiguration.cs │ │ │ ├── ApplicationUserConfiguration.cs │ │ │ ├── ApplicationUserLoginConfiguration.cs │ │ │ ├── ApplicationUserRoleClaimConfiguration.cs │ │ │ ├── ApplicationUserRoleConfiguration.cs │ │ │ └── ApplicationUserTokenConfiguration.cs │ │ ├── MultitenantDbContext.cs │ │ └── UnitOfWork.cs │ └── Seed │ │ ├── AdminDbContextInitializer.cs │ │ └── MultitenantDbContextInitializer.cs └── MultiTenant.sln ├── ObserverPattern ├── GenericSolution │ ├── ObserverPattern.sln │ └── ObserverPattern │ │ ├── ClassDiagram1.cd │ │ ├── ObserverPattern.csproj │ │ └── Program.cs └── StockNotification │ └── StockNotifications │ ├── StockNotifications.sln │ └── StockNotifications │ ├── ClassDiagram1.cd │ ├── Program.cs │ └── StockNotifications.csproj ├── PrivateRegistryDemo ├── .dockerignore ├── PrivateRegistryDemo.sln └── PrivateRegistryDemo │ ├── Controllers │ └── WeatherForecastController.cs │ ├── Dockerfile │ ├── PrivateRegistryDemo.csproj │ ├── PrivateRegistryDemo.http │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── README.md ├── aks-hrm ├── .dockerignore ├── HRM.API.sln └── HRM.API │ ├── Controllers │ ├── EmployeesController.cs │ └── WeatherForecastController.cs │ ├── Db │ └── ApplicationDbContext.cs │ ├── Dockerfile │ ├── Dockerfile_01 │ ├── Dockerfile_02 │ ├── Dockerfile_03 │ ├── HRM.API.csproj │ ├── HRM.API.http │ ├── Migrations │ ├── 20241117200844_init-mig.Designer.cs │ ├── 20241117200844_init-mig.cs │ └── ApplicationDbContextModelSnapshot.cs │ ├── Models │ └── Employee.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── deployment │ ├── pod-aks.yml │ └── service-aks.yml ├── api-gateway-ocelot-qos ├── BFF.Web │ ├── BFF.Web.csproj │ ├── Config │ │ └── AlterUpstream.cs │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Routes.dev │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.catalog-api.json │ │ └── ocelot.global.json │ ├── Routes.prod │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.catalog-api.json │ │ └── ocelot.global.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── ocelot.json ├── Catalog.API │ ├── Catalog.API.csproj │ ├── Controllers │ │ └── CatalogItemsController.cs │ ├── Db │ │ ├── CatalogContext.cs │ │ └── SeedDataProvider.cs │ ├── Model │ │ └── CatalogItem.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ └── appsettings.json └── QoS.sln ├── api-gateway-ocelot └── APIGateway │ ├── APIGateway.sln │ ├── BFF.Web │ ├── BFF.Web.csproj │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── ocelot.json │ ├── Catalog.API │ ├── Catalog.API.csproj │ ├── Controllers │ │ ├── ProductsController.cs │ │ └── WeatherForecastController.cs │ ├── Db │ │ └── CatalogContext.cs │ ├── Model │ │ └── Product.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Location.API │ ├── Controllers │ │ └── CountriesController.cs │ ├── Location.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── Ordering.API │ ├── Controllers │ ├── OrdersController.cs │ └── WeatherForecastController.cs │ ├── Db │ └── OrderingContext.cs │ ├── Models │ └── Order.cs │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── bootstrap-react-conversion └── readme.txt ├── dotnet-core-nuget-github ├── CryptoEngine │ ├── CryptoEngine.csproj │ └── CryptoGenerator.cs ├── CryptoSolution.sln └── CryptoTest │ ├── CryptoTest.csproj │ └── Program.cs ├── generic-repo-uow └── readme.txt ├── health-check └── HealthCheck │ ├── Admin.API │ ├── Admin.API.csproj │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Customer │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Customer.API.csproj │ ├── Db │ │ └── CustomerDbContext.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Utility │ │ ├── DatabaseHealthCheck.cs │ │ └── HealthCheckResponse.cs │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── HealthCheck.sln │ ├── Location.API │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Location.API.csproj │ ├── Persistence │ │ └── LocationDbContext.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Product.API │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Product.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── WebStatus │ ├── Controllers │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── WebStatus.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── hrm └── HRM │ ├── .dockerignore │ ├── HRM.API │ ├── Controllers │ │ ├── EmployeesController.cs │ │ └── WeatherForecastController.cs │ ├── Db │ │ ├── HRMContext.cs │ │ └── SeedDataGenerator.cs │ ├── Deploy │ │ └── k8s │ │ │ └── pod.yml │ ├── Dockerfile │ ├── HRM.API.csproj │ ├── Models │ │ └── Employee.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Repository │ │ ├── EmployeeRepository.cs │ │ └── IEmployeeRepository.cs │ ├── Services │ │ ├── EmployeeService.cs │ │ └── IEmployeeService.cs │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── HRM.sln ├── jenkins-demo └── HRM │ ├── .dockerignore │ ├── HRM.API │ ├── .config │ │ └── dotnet-tools.json │ ├── Controllers │ │ ├── EmployeesController.cs │ │ └── WeatherForecastController.cs │ ├── Db │ │ ├── HRMContext.cs │ │ └── SeedDataGenerator.cs │ ├── HRM.API.csproj │ ├── Models │ │ └── Employee.cs │ ├── Program.cs │ ├── Properties │ │ ├── PublishProfiles │ │ │ └── JenkinsProfile.pubxml │ │ └── launchSettings.json │ ├── Repository │ │ ├── EmployeeRepository.cs │ │ └── IEmployeeRepository.cs │ ├── Services │ │ ├── EmployeeService.cs │ │ └── IEmployeeService.cs │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── HRM.Test │ ├── HRM.Test.csproj │ └── UnitTest1.cs │ └── HRM.sln ├── kubernetes-demo ├── KubernetesDemo │ ├── .dockerignore │ ├── Catalog.API │ │ ├── Catalog.API.csproj │ │ ├── Controllers │ │ │ ├── ProductsController.cs │ │ │ └── WeatherForecastController.cs │ │ ├── Db │ │ │ └── CatalogDbContext.cs │ │ ├── Dockerfile │ │ ├── Migrations │ │ │ ├── 20220227063852_mig.Designer.cs │ │ │ ├── 20220227063852_mig.cs │ │ │ └── CatalogDbContextModelSnapshot.cs │ │ ├── Models │ │ │ └── Product.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── WeatherForecast.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── deploy │ │ │ └── k8s │ │ │ └── pod.yml │ └── KubernetesDemo.sln └── k8s-dashboard │ ├── dashboard-adminuser.yaml │ ├── recommended.yaml │ └── recommended.yaml.txt ├── micro-frontend ├── customer-backend │ ├── Customer.sln │ └── Customers.API │ │ ├── Controllers │ │ └── CustomersController.cs │ │ ├── Customers.API.csproj │ │ ├── Db │ │ ├── CustomersContext.cs │ │ └── SeedGenerator.cs │ │ ├── Model │ │ └── Customer.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json ├── customer-frontend │ ├── .gitignore │ ├── README.md │ ├── config-overrides.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── components │ │ └── CustomerComponent │ │ │ ├── CustomersListComponent.js │ │ │ └── DataTableComponent.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── pages │ │ └── CustomerPage.js │ │ ├── reportWebVitals.js │ │ ├── services │ │ └── CustomerService.js │ │ ├── setupProxy.js │ │ ├── setupTests.js │ │ └── utils │ │ ├── BaseUrl.js │ │ └── Conversions.js ├── header-frontend │ ├── .gitignore │ ├── README.md │ ├── config-overrides.js │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── components │ │ └── Header.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── reportWebVitals.js │ │ ├── setupProxy.js │ │ └── setupTests.js ├── master-frontend │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── MicroFrontend.js │ │ ├── assets │ │ └── homeStyle.css │ │ ├── common │ │ └── SideNavbar.js │ │ ├── components │ │ └── Home.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── micro-services │ │ ├── CustomerMicroServices.js │ │ ├── LayoutMicroServices.js │ │ └── ProductMicroServices.js │ │ ├── reportWebVitals.js │ │ └── setupTests.js ├── product-backend │ ├── Product.API │ │ ├── Controllers │ │ │ ├── CategoriesController.cs │ │ │ └── ProductsController.cs │ │ ├── Db │ │ │ ├── ProductContext.cs │ │ │ └── SeedGenerator.cs │ │ ├── Model │ │ │ ├── Category.cs │ │ │ └── Product.cs │ │ ├── Product.API.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ └── ProductSln.sln └── product-frontend │ ├── .gitignore │ ├── README.md │ ├── config-overrides.js │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── CategoryComponent │ │ ├── CategoryListComponent.js │ │ └── DataTableComponent.js │ └── ProductComponent │ │ ├── DataTableComponent.js │ │ └── ProductListComponent.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── pages │ ├── CategoriesPage.js │ └── ProductsPage.js │ ├── reportWebVitals.js │ ├── services │ └── ProductService.js │ ├── setupProxy.js │ ├── setupTests.js │ └── utils │ ├── BaseUrl.js │ └── Conversions.js ├── ocelot-swagger └── APIGateway │ ├── APIGateway.sln │ ├── BFF.Web │ ├── BFF.Web.csproj │ ├── Config │ │ └── AlterUpstream.cs │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Routes │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.catalog.api.json │ │ ├── ocelot.global.json │ │ ├── ocelot.location.api.json │ │ └── ocelot.ordering.api.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── ocelot.json │ ├── Catalog.API │ ├── Catalog.API.csproj │ ├── Controllers │ │ ├── ProductsController.cs │ │ └── WeatherForecastController.cs │ ├── Db │ │ └── CatalogContext.cs │ ├── Model │ │ └── Product.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Location.API │ ├── Controllers │ │ └── CountriesController.cs │ ├── Location.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── Ordering.API │ ├── Controllers │ ├── OrdersController.cs │ └── WeatherForecastController.cs │ ├── Db │ └── OrderingContext.cs │ ├── Models │ └── Order.cs │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── react-redux-toolkit ├── ECommerce │ ├── ECommerce.API │ │ ├── Controllers │ │ │ ├── CustomersController.cs │ │ │ ├── ProductsController.cs │ │ │ └── WeatherForecastController.cs │ │ ├── Db │ │ │ ├── ECommerceContext.cs │ │ │ └── SeedGenerator.cs │ │ ├── ECommerce.API.csproj │ │ ├── Models │ │ │ ├── Customer.cs │ │ │ └── Product.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── WeatherForecast.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ └── ECommerce.sln └── redux-app │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── customer │ │ ├── AddCustomer.js │ │ ├── CustomerList.js │ │ └── EditCustomer.js │ └── product │ │ ├── AddProduct.js │ │ ├── EditProduct.js │ │ └── ProductsList.js │ ├── config │ ├── BaseURL.js │ └── http-common.js │ ├── helper │ └── ToastifyMessage.js │ ├── index.css │ ├── index.js │ ├── layout │ └── TopNav.js │ ├── logo.svg │ ├── redux │ ├── slices │ │ ├── customersSlice.js │ │ └── productsSlice.js │ └── store.js │ ├── reportWebVitals.js │ ├── services │ ├── CustomerService.js │ └── ProductService.js │ ├── setupTests.js │ └── utils │ └── Conversion.js ├── saga-choreography └── ECommerce │ ├── Catalog.API │ ├── Catalog.API.csproj │ ├── Controllers │ │ └── CatalogItemsController.cs │ ├── Db │ │ ├── CatalogContext.cs │ │ └── catalog.db │ ├── Migrations │ │ ├── 20210926064658_initmig.Designer.cs │ │ ├── 20210926064658_initmig.cs │ │ └── CatalogContextModelSnapshot.cs │ ├── Models │ │ └── CatalogItem.cs │ ├── OrderCreatedListener.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── ECommerce.sln │ ├── Ordering.API │ ├── CatalogResponseListener.cs │ ├── Controllers │ │ ├── OrderController.cs │ │ └── OrderItemsController.cs │ ├── Db │ │ ├── OrderingContext.cs │ │ ├── ordering.db │ │ ├── ordering.db-shm │ │ └── ordering.db-wal │ ├── Migrations │ │ ├── 20210926082024_initmig.Designer.cs │ │ ├── 20210926082024_initmig.cs │ │ └── OrderingContextModelSnapshot.cs │ ├── Models │ │ └── OrderItem.cs │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── Shared │ ├── Models │ ├── CatalogResponse.cs │ └── OrderRequest.cs │ ├── Settings.cs │ └── Shared.csproj ├── sd-demo ├── BFF.Web │ ├── BFF.Web.csproj │ ├── Config │ │ └── AlterUpstream.cs │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Routes.dev │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.customer.api.json │ │ ├── ocelot.global.json │ │ ├── ocelot.location.api.json │ │ └── ocelot.product.api.json │ ├── Routes.prod │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.global.json │ │ └── ocelot.location.api.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── ocelot.json ├── Customer.API │ ├── Controllers │ │ ├── CustomerController.cs │ │ └── WeatherForecastController.cs │ ├── Customer.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── Location.API │ ├── Controllers │ │ ├── DistrictController.cs │ │ └── WeatherForecastController.cs │ ├── Location.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── Product.API │ ├── Controllers │ │ ├── ProductsController.cs │ │ └── WeatherForecastController.cs │ ├── Product.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json └── SDDemo.sln ├── sd-docker-demo ├── .dockerignore ├── BFF.Web │ ├── BFF.Web.csproj │ ├── Config │ │ └── AlterUpstream.cs │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Dockerfile │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Routes.dev │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.global.json │ │ └── ocelot.location.api.json │ ├── Routes.prod │ │ ├── ocelot.SwaggerEndPoints.json │ │ ├── ocelot.global.json │ │ └── ocelot.location.api.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── ocelot.json ├── LocationA.API │ ├── Controllers │ │ ├── DistrictController.cs │ │ └── WeatherForecastController.cs │ ├── Dockerfile │ ├── LocationA.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── LocationB.API │ ├── Controllers │ │ ├── DistrictController.cs │ │ └── WeatherForecastController.cs │ ├── Dockerfile │ ├── LocationB.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── LocationC.API │ ├── Controllers │ │ ├── DistrictController.cs │ │ └── WeatherForecastController.cs │ ├── Dockerfile │ ├── LocationC.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── SDDemoDocker.sln ├── docker-compose.dcproj ├── docker-compose.override.yml └── docker-compose.yml ├── service-mesh ├── Istio │ ├── elasticsearch.yaml │ ├── fluentd-istio.yaml │ ├── fluentd.yaml │ └── kibana.yaml └── ServiceMesh │ ├── .dockerignore │ ├── BFF.Web │ ├── BFF.Web.csproj │ ├── Config │ │ └── AlterUpstream.cs │ ├── Controllers │ │ └── WeatherForecastController.cs │ ├── Deploy │ │ └── k8s │ │ │ └── deployment.yml │ ├── Dockerfile │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Routes │ │ ├── Routes.Dev │ │ │ ├── ocelot.SwaggerEndPoints.json │ │ │ ├── ocelot.catalog.api.json │ │ │ ├── ocelot.global.json │ │ │ ├── ocelot.location.api.json │ │ │ └── ocelot.ordering.api.json │ │ └── Routes.Prod │ │ │ ├── ocelot.SwaggerEndPoints.json │ │ │ ├── ocelot.catalog.api.json │ │ │ ├── ocelot.global.json │ │ │ ├── ocelot.location.api.json │ │ │ └── ocelot.ordering.api.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── ocelot.json │ └── ocelot__old.json │ ├── Catalog.API │ ├── Catalog.API.csproj │ ├── Controllers │ │ ├── ProductsController.cs │ │ └── WeatherForecastController.cs │ ├── Db │ │ └── CatalogContext.cs │ ├── Deploy │ │ └── k8s │ │ │ ├── deployment.yml │ │ │ └── service.yml │ ├── Dockerfile │ ├── Model │ │ └── Product.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Location.API │ ├── Controllers │ │ └── CountriesController.cs │ ├── Deploy │ │ └── k8s │ │ │ ├── deployment.yml │ │ │ └── service.yml │ ├── Dockerfile │ ├── Location.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Ordering.API │ ├── Controllers │ │ ├── OrdersController.cs │ │ └── WeatherForecastController.cs │ ├── Db │ │ └── OrderingContext.cs │ ├── Deploy │ │ └── k8s │ │ │ ├── deployment.yml │ │ │ └── service.yml │ ├── Dockerfile │ ├── Models │ │ └── Order.cs │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json │ └── ServiceMesh.sln ├── singleton-pattern └── SingletonDemo │ ├── SingletonDemo.sln │ └── SingletonDemo │ ├── Program.cs │ └── SingletonDemo.csproj ├── token-based-auth-core-react ├── ECommerce │ ├── ECommerce.sln │ ├── Ordering.API │ │ ├── Controllers │ │ │ ├── AuthController.cs │ │ │ ├── CustomerController.cs │ │ │ ├── RoleController.cs │ │ │ └── UserController.cs │ │ ├── Db │ │ │ ├── ordering.db │ │ │ ├── ordering.db-shm │ │ │ └── ordering.db-wal │ │ ├── Ordering.API.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── Ordering.Application │ │ ├── Commands │ │ │ ├── Auth │ │ │ │ └── AuthCommand.cs │ │ │ ├── Customers │ │ │ │ ├── Create │ │ │ │ │ └── CreateCustomerCommand.cs │ │ │ │ ├── Delete │ │ │ │ │ └── DeleteCustomerCommand.cs │ │ │ │ └── Update │ │ │ │ │ └── EditCustomerCommand.cs │ │ │ ├── Role │ │ │ │ ├── Create │ │ │ │ │ └── RoleCreateCommand.cs │ │ │ │ ├── Delete │ │ │ │ │ └── DeleteRoleCommand.cs │ │ │ │ └── Update │ │ │ │ │ └── UpdateRoleCommand.cs │ │ │ └── User │ │ │ │ ├── Create │ │ │ │ └── CreateUserCommand.cs │ │ │ │ ├── Delete │ │ │ │ └── DeleteUserCommand.cs │ │ │ │ └── Update │ │ │ │ ├── AssignUsersRoleCommand.cs │ │ │ │ ├── EditUserProfileCommand.cs │ │ │ │ └── UpdateUserRolesCommand.cs │ │ ├── Common │ │ │ ├── Exceptions │ │ │ │ ├── BadRequestException.cs │ │ │ │ ├── ForbiddenAccessException.cs │ │ │ │ ├── NotFoundException.cs │ │ │ │ └── ValidationException.cs │ │ │ ├── Interfaces │ │ │ │ ├── IIdentityService.cs │ │ │ │ └── ITokenGenerator.cs │ │ │ └── Security │ │ │ │ └── TokenGenerator.cs │ │ ├── DTOs │ │ │ ├── AuthResponseDTO.cs │ │ │ ├── CustomerResponse.cs │ │ │ ├── RoleResponseDTO.cs │ │ │ ├── UserDetailsResponseDTO.cs │ │ │ └── UserResponseDTO.cs │ │ ├── DependencyInjection.cs │ │ ├── Mapper │ │ │ ├── CustomerMapper.cs │ │ │ └── OrderingMappingProfile.cs │ │ ├── Ordering.Application.csproj │ │ └── Queries │ │ │ ├── Customers │ │ │ ├── GetAllCustomerQuery.cs │ │ │ ├── GetCustomerByEmailQuery.cs │ │ │ └── GetCustomerByIdQuery.cs │ │ │ ├── Role │ │ │ ├── GetRoleByIdQuery.cs │ │ │ └── GetRoleQuery.cs │ │ │ └── User │ │ │ ├── GetAllUsersDetailsQuery.cs │ │ │ ├── GetUserDetailsByUserNameQuery.cs │ │ │ ├── GetUserDetailsQuery.cs │ │ │ └── GetUserQuery.cs │ ├── Ordering.Core │ │ ├── Entities │ │ │ ├── Base │ │ │ │ └── BaseEntity.cs │ │ │ └── Customer.cs │ │ ├── Ordering.Core.csproj │ │ └── Repositories │ │ │ ├── Command │ │ │ ├── Base │ │ │ │ └── ICommandRepository.cs │ │ │ └── ICustomerCommandRepository.cs │ │ │ └── Query │ │ │ ├── Base │ │ │ └── IQueryRepository.cs │ │ │ └── ICustomerQueryRepository.cs │ ├── Ordering.Infrastructure │ │ ├── Data │ │ │ ├── DbConnector.cs │ │ │ └── OrderingContext.cs │ │ ├── DependencyInjection.cs │ │ ├── Identity │ │ │ └── ApplicationUser.cs │ │ ├── Migrations │ │ │ ├── 20220121122702_initial-mig.Designer.cs │ │ │ ├── 20220121122702_initial-mig.cs │ │ │ ├── 20220122063619_mig02.Designer.cs │ │ │ ├── 20220122063619_mig02.cs │ │ │ ├── 20220129012637_update-application-user.Designer.cs │ │ │ ├── 20220129012637_update-application-user.cs │ │ │ ├── 20220129012921_update-application-user2.Designer.cs │ │ │ ├── 20220129012921_update-application-user2.cs │ │ │ └── OrderingContextModelSnapshot.cs │ │ ├── Ordering.Infrastructure.csproj │ │ ├── Repository │ │ │ ├── Command │ │ │ │ ├── Base │ │ │ │ │ └── CommandRepository.cs │ │ │ │ └── CustomerCommandRepository.cs │ │ │ └── Query │ │ │ │ ├── Base │ │ │ │ └── QueryRepository.cs │ │ │ │ └── CustomerQueryRepository.cs │ │ └── Services │ │ │ ├── IdentityService.cs │ │ │ └── TokenGenerator.cs │ └── Readme.txt └── ecommerce.client │ ├── .vscode │ └── launch.json │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── assets │ │ └── config.js │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── Auth │ │ ├── Login.js │ │ ├── Logout.js │ │ ├── Registration.js │ │ └── SessionManager.js │ ├── Counter.js │ ├── Customer │ │ ├── Create.jsx │ │ ├── Customers.jsx │ │ ├── Delete.jsx │ │ └── Edit.jsx │ ├── FetchData.js │ ├── Home.js │ ├── Layout.js │ ├── LoginMenu.js │ ├── NavMenu.css │ ├── NavMenu.js │ ├── Role │ │ ├── CreateRole.js │ │ ├── DeleteRole.js │ │ ├── EditRole.js │ │ └── Roles.js │ ├── User │ │ ├── CreateUser.js │ │ ├── DeleteUser.js │ │ ├── UpdateUser.js │ │ └── Users.js │ ├── UsersRoles │ │ ├── RoleList.js │ │ └── UsersRoles.js │ └── services │ │ ├── AccessAPI.js │ │ └── Settings.js │ ├── custom.css │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js ├── token-based-auth-core └── ECommerce │ ├── ECommerce.sln │ ├── Ordering.API │ ├── Controllers │ │ ├── AuthController.cs │ │ ├── CustomerController.cs │ │ ├── RoleController.cs │ │ └── UserController.cs │ ├── Db │ │ ├── ordering.db │ │ ├── ordering.db-shm │ │ └── ordering.db-wal │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ └── appsettings.json │ ├── Ordering.Application │ ├── Commands │ │ ├── Auth │ │ │ └── AuthCommand.cs │ │ ├── Customers │ │ │ ├── Create │ │ │ │ └── CreateCustomerCommand.cs │ │ │ ├── Delete │ │ │ │ └── DeleteCustomerCommand.cs │ │ │ └── Update │ │ │ │ └── EditCustomerCommand.cs │ │ ├── Role │ │ │ ├── Create │ │ │ │ └── RoleCreateCommand.cs │ │ │ ├── Delete │ │ │ │ └── DeleteRoleCommand.cs │ │ │ └── Update │ │ │ │ └── UpdateRoleCommand.cs │ │ └── User │ │ │ ├── Create │ │ │ └── CreateUserCommand.cs │ │ │ ├── Delete │ │ │ └── DeleteUserCommand.cs │ │ │ └── Update │ │ │ ├── AssignUsersRoleCommand.cs │ │ │ ├── EditUserProfileCommand.cs │ │ │ └── UpdateUserRolesCommand.cs │ ├── Common │ │ ├── Exceptions │ │ │ ├── BadRequestException.cs │ │ │ ├── ForbiddenAccessException.cs │ │ │ ├── NotFoundException.cs │ │ │ └── ValidationException.cs │ │ └── Interfaces │ │ │ ├── IIdentityService.cs │ │ │ └── ITokenGenerator.cs │ ├── DTOs │ │ ├── AuthResponseDTO.cs │ │ ├── CustomerResponse.cs │ │ ├── RoleResponseDTO.cs │ │ ├── UserDetailsResponseDTO.cs │ │ └── UserResponseDTO.cs │ ├── DependencyInjection.cs │ ├── Mapper │ │ ├── CustomerMapper.cs │ │ └── OrderingMappingProfile.cs │ ├── Ordering.Application.csproj │ └── Queries │ │ ├── Customers │ │ ├── GetAllCustomerQuery.cs │ │ ├── GetCustomerByEmailQuery.cs │ │ └── GetCustomerByIdQuery.cs │ │ ├── Role │ │ ├── GetRoleByIdQuery.cs │ │ └── GetRoleQuery.cs │ │ └── User │ │ ├── GetAllUsersDetailsQuery.cs │ │ ├── GetUserDetailsByUserNameQuery.cs │ │ ├── GetUserDetailsQuery.cs │ │ └── GetUserQuery.cs │ ├── Ordering.Core │ ├── Entities │ │ ├── Base │ │ │ └── BaseEntity.cs │ │ └── Customer.cs │ ├── Ordering.Core.csproj │ └── Repositories │ │ ├── Command │ │ ├── Base │ │ │ └── ICommandRepository.cs │ │ └── ICustomerCommandRepository.cs │ │ └── Query │ │ ├── Base │ │ └── IQueryRepository.cs │ │ └── ICustomerQueryRepository.cs │ └── Ordering.Infrastructure │ ├── Data │ ├── DbConnector.cs │ └── OrderingContext.cs │ ├── DependencyInjection.cs │ ├── Identity │ └── ApplicationUser.cs │ ├── Migrations │ ├── 20220121122702_initial-mig.Designer.cs │ ├── 20220121122702_initial-mig.cs │ ├── 20220122063619_mig02.Designer.cs │ ├── 20220122063619_mig02.cs │ ├── 20220129012637_update-application-user.Designer.cs │ ├── 20220129012637_update-application-user.cs │ ├── 20220129012921_update-application-user2.Designer.cs │ ├── 20220129012921_update-application-user2.cs │ └── OrderingContextModelSnapshot.cs │ ├── Ordering.Infrastructure.csproj │ ├── Repository │ ├── Command │ │ ├── Base │ │ │ └── CommandRepository.cs │ │ └── CustomerCommandRepository.cs │ └── Query │ │ ├── Base │ │ └── QueryRepository.cs │ │ └── CustomerQueryRepository.cs │ └── Services │ ├── IdentityService.cs │ └── TokenGenerator.cs └── token-based-auth-ng ├── ECommerce ├── ECommerce.sln ├── Ordering.API │ ├── Controllers │ │ ├── AuthController.cs │ │ ├── CustomerController.cs │ │ ├── RoleController.cs │ │ └── UserController.cs │ ├── Db │ │ ├── ordering.db │ │ ├── ordering.db-shm │ │ └── ordering.db-wal │ ├── Ordering.API.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.Development.json │ └── appsettings.json ├── Ordering.Application │ ├── Commands │ │ ├── Auth │ │ │ └── AuthCommand.cs │ │ ├── Customers │ │ │ ├── Create │ │ │ │ └── CreateCustomerCommand.cs │ │ │ ├── Delete │ │ │ │ └── DeleteCustomerCommand.cs │ │ │ └── Update │ │ │ │ └── EditCustomerCommand.cs │ │ ├── Role │ │ │ ├── Create │ │ │ │ └── RoleCreateCommand.cs │ │ │ ├── Delete │ │ │ │ └── DeleteRoleCommand.cs │ │ │ └── Update │ │ │ │ └── UpdateRoleCommand.cs │ │ └── User │ │ │ ├── Create │ │ │ └── CreateUserCommand.cs │ │ │ ├── Delete │ │ │ └── DeleteUserCommand.cs │ │ │ └── Update │ │ │ ├── AssignUsersRoleCommand.cs │ │ │ ├── EditUserProfileCommand.cs │ │ │ └── UpdateUserRolesCommand.cs │ ├── Common │ │ ├── Exceptions │ │ │ ├── BadRequestException.cs │ │ │ ├── ForbiddenAccessException.cs │ │ │ ├── NotFoundException.cs │ │ │ └── ValidationException.cs │ │ ├── Interfaces │ │ │ ├── IIdentityService.cs │ │ │ └── ITokenGenerator.cs │ │ └── Security │ │ │ └── TokenGenerator.cs │ ├── DTOs │ │ ├── AuthResponseDTO.cs │ │ ├── CustomerResponse.cs │ │ ├── RoleResponseDTO.cs │ │ ├── UserDetailsResponseDTO.cs │ │ └── UserResponseDTO.cs │ ├── DependencyInjection.cs │ ├── Mapper │ │ ├── CustomerMapper.cs │ │ └── OrderingMappingProfile.cs │ ├── Ordering.Application.csproj │ └── Queries │ │ ├── Customers │ │ ├── GetAllCustomerQuery.cs │ │ ├── GetCustomerByEmailQuery.cs │ │ └── GetCustomerByIdQuery.cs │ │ ├── Role │ │ ├── GetRoleByIdQuery.cs │ │ └── GetRoleQuery.cs │ │ └── User │ │ ├── GetAllUsersDetailsQuery.cs │ │ ├── GetUserDetailsByUserNameQuery.cs │ │ ├── GetUserDetailsQuery.cs │ │ └── GetUserQuery.cs ├── Ordering.Core │ ├── Entities │ │ ├── Base │ │ │ └── BaseEntity.cs │ │ └── Customer.cs │ ├── Ordering.Core.csproj │ └── Repositories │ │ ├── Command │ │ ├── Base │ │ │ └── ICommandRepository.cs │ │ └── ICustomerCommandRepository.cs │ │ └── Query │ │ ├── Base │ │ └── IQueryRepository.cs │ │ └── ICustomerQueryRepository.cs ├── Ordering.Infrastructure │ ├── Data │ │ ├── DbConnector.cs │ │ └── OrderingContext.cs │ ├── DependencyInjection.cs │ ├── Identity │ │ └── ApplicationUser.cs │ ├── Migrations │ │ ├── 20220121122702_initial-mig.Designer.cs │ │ ├── 20220121122702_initial-mig.cs │ │ ├── 20220122063619_mig02.Designer.cs │ │ ├── 20220122063619_mig02.cs │ │ ├── 20220129012637_update-application-user.Designer.cs │ │ ├── 20220129012637_update-application-user.cs │ │ ├── 20220129012921_update-application-user2.Designer.cs │ │ ├── 20220129012921_update-application-user2.cs │ │ └── OrderingContextModelSnapshot.cs │ ├── Ordering.Infrastructure.csproj │ ├── Repository │ │ ├── Command │ │ │ ├── Base │ │ │ │ └── CommandRepository.cs │ │ │ └── CustomerCommandRepository.cs │ │ └── Query │ │ │ ├── Base │ │ │ └── QueryRepository.cs │ │ │ └── CustomerQueryRepository.cs │ └── Services │ │ ├── IdentityService.cs │ │ └── TokenGenerator.cs └── Readme.txt └── readme.txt /Archive/ECommerce/Model/IJwtAuth.cs: -------------------------------------------------------------------------------- 1 | namespace ECommerce.Model 2 | { 3 | public interface IJwtAuth 4 | { 5 | string Authentication(string username, string password); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Archive/ECommerce/Model/LoginVM.cs: -------------------------------------------------------------------------------- 1 | namespace ECommerce.Model 2 | { 3 | public class LoginVM 4 | { 5 | public string UserName { get; set; } 6 | public string Password { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Archive/ECommerce/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ECommerce 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Archive/ECommerce/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Archive/ECommerce/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Models/CustomAuditEntry.cs: -------------------------------------------------------------------------------- 1 | using Z.EntityFramework.Plus; 2 | 3 | namespace AuditLog.API.Models 4 | { 5 | // CustomAuditEntry is a custom class that inherits from AuditEntry 6 | // It is used to add additional properties to the AuditEntry class 7 | public class CustomAuditEntry : AuditEntry 8 | { 9 | // ApplicationName is a custom property that will be added to the AuditEntry table for storing the application name 10 | public string AppplicationName { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Models/CustomAuditEntryProperty.cs: -------------------------------------------------------------------------------- 1 | using Z.EntityFramework.Plus; 2 | 3 | namespace AuditLog.API.Models 4 | { 5 | public class CustomAuditEntryProperty : AuditEntryProperty 6 | { 7 | // ApplicationName is a custom property that will be added to the AuditEntryProperty table 8 | // for storing the application name 9 | public string AppplicationName { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Models/Customer.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.Models 2 | { 3 | public class Customer 4 | { 5 | public int Id { get; set; } 6 | public string? FirstName { get; set; } 7 | public string? LastName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Repositories/Interfaces/ICustomerRepository.cs: -------------------------------------------------------------------------------- 1 | using AuditLog.API.Models; 2 | 3 | namespace AuditLog.API.Repositories.Interfaces 4 | { 5 | public interface ICustomerRepository 6 | { 7 | Task> GetCustomers(); 8 | Task GetCustomer(int id); 9 | Task AddCustomer(Customer customer); 10 | Task UpdateCustomer(Customer customer); 11 | Task DeleteCustomer(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Repositories/Interfaces/IReportingRepositry.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.Repositories.Interfaces 2 | { 3 | public interface IReportingRepositry 4 | { 5 | // Get all the changes for a particular entity response using Dynamic type 6 | Task> GetChangeLogDynamic(string EntityName); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Services/Interfaces/ICustomerService.cs: -------------------------------------------------------------------------------- 1 | using AuditLog.API.Models; 2 | 3 | namespace AuditLog.API.Services.Interfaces 4 | { 5 | public interface ICustomerService 6 | { 7 | Task> GetCustomers(); 8 | Task GetCustomer(int id); 9 | Task AddCustomer(Customer customer); 10 | Task UpdateCustomer(Customer customer); 11 | Task DeleteCustomer(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/Services/Interfaces/IReportingService.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.Services.Interfaces 2 | { 3 | public interface IReportingService 4 | { 5 | 6 | // Get all the changes for a particular entity response using Dynamic type 7 | Task> GetChangeLogDynamic(string EntityName); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AuditLogEFPlus/AuditLog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=AuditLogEFPlusDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/AuditTrail/Enums/ApplicationEnum.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace AuditLog.API.AuditTrail.Enums 4 | { 5 | // This enum is used to identify the names of applications that is being audited. 6 | public enum ApplicationEnum 7 | { 8 | [Description("AuditLog.API")] 9 | AuditLogAPP, 10 | 11 | [Description("ECommerce Application")] 12 | ECommerceAPP 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/AuditTrail/Enums/StateName.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.AuditTrail.Enums 2 | { 3 | // State of the operation performed on the entity. 4 | public enum StateName 5 | { 6 | EntityAdded, 7 | EntityModified, 8 | EntityDeleted 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/AuditTrail/Interfaces/IAuditTrail.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.AuditTrail.Interfaces 2 | { 3 | public interface IAuditTrail 4 | { 5 | void Insert(T entity); 6 | void Update(T oldEntity, T newEntity); 7 | void Delete(T oldEntity); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.Models 2 | { 3 | public class Product 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } = String.Empty; 7 | public decimal Price { get; set; } = 0; 8 | public int Quantity { get; set; } = 0; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/Repositories/Interfaces/IProductRepository.cs: -------------------------------------------------------------------------------- 1 | using AuditLog.API.Models; 2 | 3 | namespace AuditLog.API.Repositories.Interfaces 4 | { 5 | public interface IProductRepository 6 | { 7 | Task> GetProducts(); 8 | Task GetProduct(int id); 9 | Task AddProduct(Product product); 10 | Task UpdateProduct(Product product); 11 | Task DeleteProduct(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/Repositories/Interfaces/IReportingRepository.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.Repositories.Interfaces 2 | { 3 | public interface IReportingRepository 4 | { 5 | // Get all the changes for a particular entity response using Dynamic type 6 | Task> GetChangeLogDynamic(string EntityName); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/Services/Interfaces/IProductService.cs: -------------------------------------------------------------------------------- 1 | using AuditLog.API.Models; 2 | 3 | namespace AuditLog.API.Services.Interfaces 4 | { 5 | public interface IProductService 6 | { 7 | Task> GetProducts(); 8 | Task GetProduct(int id); 9 | Task AddProduct(Product product); 10 | Task UpdateProduct(Product product); 11 | Task DeleteProduct(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/Services/Interfaces/IReportingService.cs: -------------------------------------------------------------------------------- 1 | namespace AuditLog.API.Services.Interfaces 2 | { 3 | public interface IReportingService 4 | { 5 | // Get all the changes for a particular entity response using Dynamic type 6 | Task> GetChangeLogDynamic(string EntityName); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AuditLogRawSQL/AuditLog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=AuditLogDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /CacheRefreshFunction/CacheRefreshAzureFunction/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Functions.Worker; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace CacheRefreshAzureFunction 5 | { 6 | internal class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | FunctionsDebugger.Enable(); 11 | 12 | var host = new HostBuilder() 13 | .ConfigureFunctionsWorkerDefaults() 14 | .Build(); 15 | 16 | host.Run(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CacheRefreshFunction/CacheRefreshAzureFunction/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "CacheRefreshAzureFunction": { 4 | "commandName": "Project", 5 | "commandLineArgs": "--port 7239", 6 | "launchBrowser": false 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /CacheRefreshFunction/CacheRefreshAzureFunction/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "appInsights1": { 4 | "type": "appInsights", 5 | "connectionId": "APPLICATIONINSIGHTS_CONNECTION_STRING" 6 | }, 7 | "storage1": { 8 | "type": "storage", 9 | "connectionId": "AzureWebJobsStorage" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /CacheRefreshFunction/CacheRefreshAzureFunction/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "appInsights1": { 4 | "type": "appInsights.sdk" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /CacheRefreshFunction/CacheRefreshAzureFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.API/Db/Ordering.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.API/Db/Ordering.db -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "ConnectionStrings": { 10 | "DefaultConnection": "Data Source=db/ordering.db" 11 | }, 12 | "AllowedHosts": "*" 13 | } 14 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Application/Commands/DeleteCustomerCommand.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using System; 3 | 4 | namespace Ordering.Application.Commands 5 | { 6 | // Customer create command with string response 7 | public class DeleteCustomerCommand : IRequest 8 | { 9 | public Int64 Id { get; private set; } 10 | 11 | public DeleteCustomerCommand(Int64 Id) 12 | { 13 | this.Id = Id; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Application/Ordering.Application.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Application/Queries/GetAllCustomerQuery.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using Ordering.Core.Entities; 3 | using System.Collections.Generic; 4 | 5 | namespace Ordering.Application.Queries 6 | { 7 | // Customer query with List response 8 | public record GetAllCustomerQuery : IRequest> 9 | { 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Application/Queries/GetCustomerByEmailQuery.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using Ordering.Core.Entities; 3 | 4 | namespace Ordering.Application.Queries 5 | { 6 | // Customer GetCustomerByEmailQuery with Customer response 7 | public class GetCustomerByEmailQuery: IRequest 8 | { 9 | public string Email { get; private set; } 10 | 11 | public GetCustomerByEmailQuery(string email) 12 | { 13 | this.Email = email; 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Application/Queries/GetCustomerByIdQuery.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using Ordering.Core.Entities; 3 | using System; 4 | 5 | namespace Ordering.Application.Queries 6 | { 7 | // Customer GetCustomerByIdQuery with Customer response 8 | public class GetCustomerByIdQuery: IRequest 9 | { 10 | public Int64 Id { get; private set; } 11 | 12 | public GetCustomerByIdQuery(Int64 Id) 13 | { 14 | this.Id = Id; 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Application/Response/CustomerResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Ordering.Application.Response 4 | { 5 | // Customer response or DTO class 6 | public class CustomerResponse 7 | { 8 | public Int64 Id { get; set; } 9 | public string FirstName { get; set; } 10 | public string LastName { get; set; } 11 | public string Email { get; set; } 12 | public string ContactNumber { get; set; } 13 | public string Address { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Core/Entities/Customer.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities.Base; 2 | 3 | namespace Ordering.Core.Entities 4 | { 5 | // Customer entity 6 | public class Customer : BaseEntity 7 | { 8 | public string FirstName { get; set; } 9 | public string LastName { get; set; } 10 | public string Email { get; set; } 11 | public string ContactNumber { get; set; } 12 | public string Address { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Core/Ordering.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Core/Repositories/Command/Base/ICommandRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Ordering.Core.Repositories.Command.Base 4 | { 5 | // Generic interface for command repository 6 | public interface ICommandRepository where T : class 7 | { 8 | Task AddAsync(T entity); 9 | Task UpdateAsync(T entity); 10 | Task DeleteAsync(T entity); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Core/Repositories/Command/ICustomerCommandRepository.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities; 2 | using Ordering.Core.Repositories.Command.Base; 3 | 4 | namespace Ordering.Core.Repositories.Command 5 | { 6 | // Interface for customer command repository 7 | public interface ICustomerCommandRepository : ICommandRepository 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Core/Repositories/Query/Base/IQueryRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Core.Repositories.Query.Base 2 | { 3 | // Generic repository for query 4 | public interface IQueryRepository where T : class 5 | { 6 | // Generic repository for all if any 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /CleanArchitectureDemo/Ecommerce/Services/Ordering/Ordering.Infrastructure/Data/OrderingContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Ordering.Core.Entities; 3 | 4 | namespace Ordering.Infrastructure.Data 5 | { 6 | // Context class for command 7 | public class OrderingContext : DbContext 8 | { 9 | public OrderingContext(DbContextOptions options) : base (options) 10 | { 11 | 12 | } 13 | 14 | public DbSet Customers { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.API/Controllers/HomesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace CleanArch.API.Controllers 5 | { 6 | [Route("api/[controller]")] 7 | [ApiController] 8 | public class HomesController : ControllerBase 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Commands/Class1.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.Commands 2 | { 3 | internal class Class1 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Common/Exceptions/BadRequestException.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.Common.Exceptions 2 | { 3 | public class BadRequestException : Exception 4 | { 5 | public BadRequestException() : base("Invalid Request") 6 | { 7 | } 8 | 9 | public BadRequestException(string message) : base(message) 10 | { 11 | } 12 | 13 | public BadRequestException(string message, Exception ex) : base(message, ex) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Common/Exceptions/ForbiddenAccessException.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.Common.Exceptions 2 | { 3 | public class ForbiddenAccessException : Exception 4 | { 5 | public ForbiddenAccessException() : base("You are not authorized") { } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Common/Interfaces/ICurrentUserService.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.Common.Interfaces 2 | { 3 | public interface ICurrentUserService 4 | { 5 | string UserId { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Common/Interfaces/Repositories/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.Common.Interfaces.Repositories 2 | { 3 | public interface IUnitOfWork 4 | { 5 | Task CommitAsync(CancellationToken cancellationToken = new CancellationToken()); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Common/Mappings/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace CleanArch.Application.Common.Mappings 4 | { 5 | public class MappingProfile : Profile 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/DTOs/Class1.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.DTOs 2 | { 3 | internal class Class1 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Application/Queries/Class1.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Application.Queries 2 | { 3 | internal class Class1 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Core/CleanArch.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Infrastructure/Configs/ConfigurationSettings.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Infrastructure.Configs 2 | { 3 | public class ConfigurationSettings 4 | { 5 | public ConnectionStrings ConnectionStrings { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /CleanArchitectureTemplate/CleanArchitecture/CleanArch.Infrastructure/Configs/ConnectionStrings.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArch.Infrastructure.Configs 2 | { 3 | public class ConnectionStrings 4 | { 5 | public string ConfigurationDbConnection { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ConcurrencyAppToken/ConcurrencyHandling.API/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using ConcurrencyHandling.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace ConcurrencyHandling.API.Data 5 | { 6 | public class ApplicationDbContext : DbContext 7 | { 8 | public DbSet? Booking { get; set; } 9 | 10 | public ApplicationDbContext(DbContextOptions options) : base(options) 11 | { 12 | 13 | } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ConcurrencyAppToken/ConcurrencyHandling.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ConcurrencyHandling.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ConcurrencyAppToken/ConcurrencyHandling.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ConcurrencyAppToken/ConcurrencyHandling.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=ConcurrencyAppTokenDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /ConcurrencyDBToken/ConcurrencyHandling.API/Models/Account.cs: -------------------------------------------------------------------------------- 1 | using Swashbuckle.AspNetCore.Annotations; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace ConcurrencyHandling.API.Models 5 | { 6 | public class Account 7 | { 8 | public int AccountID { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal Balance { get; set; } 13 | 14 | [Timestamp] 15 | public byte[] RowVersion { get; set; } = new byte[8]; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ConcurrencyDBToken/ConcurrencyHandling.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ConcurrencyHandling.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ConcurrencyDBToken/ConcurrencyHandling.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ConcurrencyDBToken/ConcurrencyHandling.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=ConcurrencyDBTokenDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /ConcurrencyEtags/ConcurrencyHandling.API/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using ConcurrencyHandling.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace ConcurrencyHandling.API.Data 5 | { 6 | public class ApplicationDbContext : DbContext 7 | { 8 | public ApplicationDbContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | public DbSet? Product { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ConcurrencyEtags/ConcurrencyHandling.API/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace ConcurrencyHandling.API.Models 2 | { 3 | public class Product 4 | { 5 | public int ProductId { get; set; } 6 | public string? Name { get; set; } 7 | public decimal Price { get; set; } 8 | public int StockQuantity { get; set; } 9 | 10 | // Concurrency control properties 11 | public Guid RecordVersion { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ConcurrencyEtags/ConcurrencyHandling.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ConcurrencyHandling.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ConcurrencyEtags/ConcurrencyHandling.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ConcurrencyEtags/ConcurrencyHandling.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=ConcurrencyEtagsDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /ConcurrencyHyperMedia/ConcurrencyHandling.API/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using ConcurrencyHandling.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace ConcurrencyHandling.API.Data 5 | { 6 | public class ApplicationDbContext : DbContext 7 | { 8 | public ApplicationDbContext(DbContextOptions options) : base(options) 9 | { 10 | } 11 | public DbSet? Employee { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ConcurrencyHyperMedia/ConcurrencyHandling.API/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace ConcurrencyHandling.API.Models 2 | { 3 | public class Employee 4 | { 5 | public int EmployeeID { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Salary { get; set; } 10 | 11 | public Guid RowVersion { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ConcurrencyHyperMedia/ConcurrencyHandling.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ConcurrencyHandling.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ConcurrencyHyperMedia/ConcurrencyHandling.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ConcurrencyHyperMedia/ConcurrencyHandling.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=ConcurrencyHyperMediaDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /ConcurrencyRawSQL/Concurrency.API/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace Concurrency.API.Models 2 | { 3 | public class Product 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } = String.Empty; 7 | public decimal Price { get; set; } = 0; 8 | public int Quantity { get; set; } = 0; 9 | public Guid RowVersion { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ConcurrencyRawSQL/Concurrency.API/Repositories/Interfaces/IProductRepository.cs: -------------------------------------------------------------------------------- 1 |  2 | using Concurrency.API.Models; 3 | 4 | namespace Concurrency.API.Repositories.Interfaces 5 | { 6 | public interface IProductRepository 7 | { 8 | Task> GetProducts(); 9 | Task GetProduct(int id); 10 | Task AddProduct(Product product); 11 | Task UpdateProduct(Product product); 12 | Task DeleteProduct(int id, Guid rowVersion); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ConcurrencyRawSQL/Concurrency.API/Services/Interfaces/IProductService.cs: -------------------------------------------------------------------------------- 1 | using Concurrency.API.Models; 2 | 3 | namespace Concurrency.API.Services.Interfaces 4 | { 5 | public interface IProductService 6 | { 7 | Task> GetProducts(); 8 | Task GetProduct(int id); 9 | Task AddProduct(Product product); 10 | Task UpdateProduct(Product product); 11 | Task DeleteProduct(int id, Guid rowVersion); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ConcurrencyRawSQL/Concurrency.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ConcurrencyRawSQL/Concurrency.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=localhost;Database=ConcurrencySQLDB;User Id=sa;Password=oLdViCtOrY2008;TrustServerCertificate=True;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/Entities/BaseEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Ordering.API.Entities 4 | { 5 | public abstract class BaseEntity 6 | { 7 | public Int64 Id { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/Entities/Customer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Ordering.API.Entities 4 | { 5 | public class Customer : BaseEntity 6 | { 7 | public string FirstName { get; set; } 8 | public string LastName { get; set; } 9 | public string Email { get; set; } 10 | public string ContactNumber { get; set; } 11 | public string Address { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/Ordering.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/Repositories/ICustomerRepository.cs: -------------------------------------------------------------------------------- 1 | using Ordering.API.Entities; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Ordering.API.Repositories 6 | { 7 | public interface ICustomerRepository : IGenericRepository 8 | { 9 | Task> GetAllByEmailId(string email); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/Repositories/IGenericRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Ordering.API.Repositories 6 | { 7 | public interface IGenericRepository 8 | { 9 | Task> GetAllAsync(); 10 | Task GetByIdAsync(Int64 id); 11 | Task CreateAsync(T entity); 12 | Task UpdateAsync(T entity); 13 | Task DeleteAsync(T entity); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DapperDemo/DapperDemo/Customer.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | 10 | "ConnectionStrings": { 11 | "DefaultConnection": "Data Source=localhost;Initial Catalog=OrderingDB;User ID=sa;Password=yourdbpassword" 12 | }, 13 | 14 | "AllowedHosts": "*" 15 | } 16 | -------------------------------------------------------------------------------- /DapperDemo/Utility/scripts.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/DapperDemo/Utility/scripts.sql -------------------------------------------------------------------------------- /ECommerceFacade/ECommerceFacade/ECommerceFacade.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /EFBulkBatch/EFBulkBatch/Db/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using EFBulkBatch.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace EFBulkBatch.Db 5 | { 6 | public class ApplicationDbContext : DbContext 7 | { 8 | public ApplicationDbContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | 13 | public DbSet Employees { get; set; } 14 | public DbSet Customers { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EFBulkBatch/EFBulkBatch/Models/Customer.cs: -------------------------------------------------------------------------------- 1 | namespace EFBulkBatch.Models 2 | { 3 | public class Customer 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Email { get; set; } 8 | public string Phone { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EFBulkBatch/EFBulkBatch/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace EFBulkBatch.Models 2 | { 3 | public class Employee 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Designation { get; set;} 8 | public string Department { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EFBulkBatch/EFBulkBatch/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace EFBulkBatch 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateOnly Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /EFBulkBatch/EFBulkBatch/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /EFBulkBatch/EFBulkBatch/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "DefaultConnection": "Server=.;Database=EFBulkBatchDB; User Id = sa; Password = oLdViCtOrY2008; TrustServerCertificate=True;" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /EventSourcing/Application/Common/Interfaces/ICatalogItemAggregateRepository_old.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Application.Common.Interfaces 8 | { 9 | public interface ICatalogItemAggregateRepository_old 10 | { 11 | Task SaveAsync(object @event); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /EventSourcing/Application/Common/Interfaces/ICatalogItemRepository.cs: -------------------------------------------------------------------------------- 1 | using Domain.Entities; 2 | 3 | namespace Application.Common.Interfaces 4 | { 5 | public interface ICatalogItemRepository 6 | { 7 | Task AddAsync(CatalogItem catalogItem); 8 | Task UpdateAsync(CatalogItem catalogItem); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /EventSourcing/Application/DependencyInjection.cs: -------------------------------------------------------------------------------- 1 | using MediatR; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using System.Reflection; 4 | 5 | namespace Application 6 | { 7 | public static class DependencyInjection 8 | { 9 | public static IServiceCollection AddApplication(this IServiceCollection services) 10 | { 11 | //Add MediatR to the Pipe line 12 | services.AddMediatR(Assembly.GetExecutingAssembly()); 13 | return services; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EventSourcing/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /EventSourcing/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "DefaultConnection": "Data Source=localhost;Initial Catalog=CatalogDB;Persist Security Info=False;User ID=sa; Password = oLdViCtOrY2008;Pooling=False;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=False" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /EventSourcing/Domain/Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /EventSourcing/Domain/Entities/Common/BaseEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.Entities.Common 2 | { 3 | /// 4 | /// Base class for BaseAggregateRoot class 5 | /// Shared for all entities 6 | /// 7 | /// 8 | public abstract class BaseEntity : IBaseEntity 9 | { 10 | protected BaseEntity() { } 11 | protected BaseEntity(TKey id) => Id = id; 12 | 13 | //Implementation of interface 14 | public TKey Id { get; protected set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EventSourcing/Domain/Entities/Common/IAggregateRoot.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.Entities.Common 2 | { 3 | /// 4 | /// Interface for AggregateRoot 5 | /// IAggregateRoot is the combination of IBaseEntity and IAggregateRoot 6 | /// 7 | /// 8 | public interface IAggregateRoot : IBaseEntity 9 | { 10 | long Version { get; } 11 | IReadOnlyCollection> Events { get; } 12 | void ClearEvents(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /EventSourcing/Domain/Entities/Common/IBaseEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.Entities.Common 2 | { 3 | /// Ref: Coverience in C# 4 | /// 5 | /// Interface for Base Entity 6 | /// 7 | /// 8 | public interface IBaseEntity 9 | { 10 | TKey Id { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /EventSourcing/Domain/Entities/Common/IDomainEvent.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.Entities.Common 2 | { 3 | 4 | /// 5 | /// Interface for Domain Event 6 | /// 7 | /// 8 | public interface IDomainEvent 9 | { 10 | public long AggregateVersion { get; } 11 | TKey AggregateId { get; } 12 | DateTime TimeStamp { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /FacadePattern/FacadePattern/FacadePattern/FacadePattern.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IValidatebleObject/IValidatebleObjectDemo/IValidatebleObjectDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IdempotentDemo/Accounting.API/Db/AccountingContext.cs: -------------------------------------------------------------------------------- 1 | using Accounting.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace Accounting.API.Db 5 | { 6 | public class AccountingContext : DbContext 7 | { 8 | public AccountingContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | 13 | public DbSet TransactionDetails { get; set; } 14 | } 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /IdempotentDemo/Accounting.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /IdempotentDemo/Accounting.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "AccountingDBConnection": "Server=localhost;Database=AccountingDB;User Id=sa;Password=oLdViCtOrY2008;" 11 | }, 12 | //Redis Server 13 | "Redis": { 14 | "Server": "localhost:6379" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Constants/UserRolesConstants.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Common.Constants 2 | { 3 | public static class UserRolesConstants 4 | { 5 | public const string SuperAdmin = "Super Admin"; 6 | public const string Admin = "Admin"; 7 | public const string User = "User"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Exceptions/BadRequestException.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Common.Exceptions 2 | { 3 | public class BadRequestException : Exception 4 | { 5 | public BadRequestException() : base() 6 | { 7 | } 8 | 9 | public BadRequestException(string message) : base(message) 10 | { 11 | } 12 | 13 | public BadRequestException(string message, Exception ex) : base(message, ex) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Exceptions/IdentityResultException.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Application.Common.Exceptions 4 | { 5 | public class IdentityResultException : Exception 6 | { 7 | public string ErrorMessage { get; set; } 8 | public IdentityResultException(IdentityResult identityResult, string? message) : base(message) 9 | { 10 | ErrorMessage = string.Join("\n", identityResult.Errors.Select(x => x.Description).ToList()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Mappings/CustomerMappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using MTShop.Application.Commands.Customer; 3 | using MTShop.Application.DTOs; 4 | using MTShop.Core.Entities; 5 | 6 | namespace MTShop.Application.Common.Mappings 7 | { 8 | public class CustomerMappingProfile : Profile 9 | { 10 | public CustomerMappingProfile() 11 | { 12 | CreateMap().ReverseMap(); 13 | CreateMap(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Mappings/ProductMappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using MTShop.Application.Commands.Products; 3 | using MTShop.Application.DTOs; 4 | using MTShop.Core.Entities; 5 | 6 | namespace MTShop.Application.Common.Mappings 7 | { 8 | public class ProductMappingProfile : Profile 9 | { 10 | public ProductMappingProfile() 11 | { 12 | CreateMap().ReverseMap(); 13 | CreateMap(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Models/ErrorDetails.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | 3 | namespace MTShop.Application.Common.Models 4 | { 5 | public class ErrorDetails 6 | { 7 | public int StatusCode { get; set; } 8 | public string Message { get; set; } 9 | public override string ToString() 10 | { 11 | return JsonSerializer.Serialize(this); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Settings/DBConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Common.Settings 2 | { 3 | public class DBConfiguration 4 | { 5 | public string DBProvider { get; set; } 6 | public string ConnectionString { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Settings/Tenant.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Common.Settings 2 | { 3 | public class Tenant 4 | { 5 | public string Name { get; set; } 6 | public string TId { get; set; } 7 | public string ConnectionString { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Common/Settings/TenantSettings.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Common.Settings 2 | { 3 | public class TenantSettings 4 | { 5 | public DBConfiguration Defaults { get; set; } 6 | public List Tenants { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/DTOs/AuthResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.DTOs 2 | { 3 | public class AuthResponseDTO 4 | { 5 | public string UserId { get; set; } 6 | public string UserName { get; set; } 7 | public string Token { get; set; } 8 | public DateTime ExpirationTime { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/DTOs/ProductDTO.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.DTOs 2 | { 3 | public class ProductDTO 4 | { 5 | public Guid Id { get; set; } 6 | public string Name { get; set; } 7 | public string Description { get; set; } 8 | public int Rate { get; set; } 9 | public string TenantId { get; set; } 10 | public string CreatedBy { get; set; } 11 | public DateTime CreatedDate { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/DTOs/RoleDto.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.DTOs 2 | { 3 | public class RoleDTO 4 | { 5 | public string Id { get; set; } 6 | public string RoleName { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/DTOs/TenantDTO.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.DTOs 2 | { 3 | public class TenantDTO 4 | { 5 | public string TenantName { get; set; } 6 | public string TenantKey { get; set; } 7 | public string DatabaseServer { get; set; } 8 | public string? UserName { get; set; } 9 | public string? Password { get; set; } 10 | public string ConnectionString { get; set; } 11 | public string DBProvider { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/DTOs/UserResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.DTOs 2 | { 3 | public class UserResponseDTO 4 | { 5 | public string UserName { get; set; } 6 | public string Email { get; set; } 7 | public string TenantId { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/IMultitenantDbContextInitializer.cs: -------------------------------------------------------------------------------- 1 | using MTShop.Application.Common.Models; 2 | using MTShop.Core.Entities.Identity; 3 | 4 | namespace MTShop.Application 5 | { 6 | public interface IMultitenantDbContextInitializer 7 | { 8 | Task SeedAsync(List? defaultRoles, List defaultUsers, string tenantId); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Interfaces/IAdminUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Interfaces 2 | { 3 | public interface IAdminUnitOfWork 4 | { 5 | Task CommitAsync(); 6 | } 7 | } -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Interfaces/ICurrentUserService.cs: -------------------------------------------------------------------------------- 1 | namespace MTShop.Application.Interfaces 2 | { 3 | public interface ICurrentUserService 4 | { 5 | string UserId { get; } 6 | string UserName { get; } 7 | string TenantId { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Interfaces/ITenantService.cs: -------------------------------------------------------------------------------- 1 | using MTShop.Application.Common.Settings; 2 | 3 | namespace MTShop.Application.Interfaces 4 | { 5 | public interface ITenantService 6 | { 7 | public string GetDatabaseProvider(); 8 | public string GetConnectionString(); 9 | public Tenant GetTenant(); 10 | //public TenantEntity GetTenant(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Interfaces/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using MTShop.Core.Entities.Admin; 2 | 3 | namespace MTShop.Application.Interfaces 4 | { 5 | public interface IUnitOfWork 6 | { 7 | Task CommitAsync(); 8 | Task MigrateTenantDatabase(TenantEntity tenant); 9 | } 10 | } -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Interfaces/Repositories/ICustomerRepository.cs: -------------------------------------------------------------------------------- 1 | using MTShop.Core.Entities; 2 | 3 | namespace MTShop.Application.Interfaces.Repositories 4 | { 5 | public interface ICustomerRepository 6 | { 7 | Task> GetAllAsync(); 8 | Task GetByIdAsync(Guid id); 9 | Task CreateAsync(Customer customer); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Application/Interfaces/Repositories/IProductRepository.cs: -------------------------------------------------------------------------------- 1 | using MTShop.Core.Entities; 2 | 3 | namespace MTShop.Application.Interfaces.Repositories 4 | { 5 | public interface IProductRepository 6 | { 7 | Task> GetAllAsync(); 8 | Task GetByIdAsync(Guid id); 9 | Task CreateAsync(Product product); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Contracts/IMustHaveTenant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MTShop.Core.Contracts 8 | { 9 | public interface IMustHaveTenant 10 | { 11 | public string TenantId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationRole.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Admin.Identity 4 | { 5 | public class AdminApplicationRole : IdentityRole 6 | { 7 | public bool IsDeleted { get; set; } = false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Admin.Identity 4 | { 5 | public class AdminApplicationUser : IdentityUser 6 | { 7 | public bool IsDeleted { get; set; } = false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationUserClaim.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MTShop.Core.Entities.Admin.Identity 9 | { 10 | public class AdminApplicationUserClaim : IdentityUserClaim 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationUserLogin.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Admin.Identity 4 | { 5 | public class AdminApplicationUserLogin : IdentityUserLogin 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationUserRole.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Admin.Identity 4 | { 5 | public class AdminApplicationUserRole : IdentityUserRole 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationUserRoleClaim.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Admin.Identity 4 | { 5 | public class AdminApplicationUserRoleClaim : IdentityRoleClaim 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Admin/Identity/AdminApplicationUserToken.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Admin.Identity 4 | { 5 | public class AdminApplicationUserToken : IdentityUserToken 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Customer.cs: -------------------------------------------------------------------------------- 1 | using MTShop.Core.Contracts; 2 | using MTShop.Core.Entities.Base; 3 | 4 | namespace MTShop.Core.Entities 5 | { 6 | public class Customer : BaseEntity, IMustHaveTenant 7 | { 8 | public string FullName { get; set; } 9 | public string FathersName { get; set; } 10 | public string MothersName { get; set; } 11 | public string Email { get; set; } 12 | public DateTime DateOfBirth { get; set; } 13 | public string TenantId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationRole.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using MTShop.Core.Contracts; 3 | 4 | namespace MTShop.Core.Entities.Identity 5 | { 6 | public class ApplicationRole : IdentityRole, IMustHaveTenant 7 | { 8 | public string TenantId { get; set; } 9 | public bool IsDeleted { get; set; } = false; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using MTShop.Core.Contracts; 3 | 4 | namespace MTShop.Core.Entities.Identity 5 | { 6 | public class ApplicationUser : IdentityUser, IMustHaveTenant 7 | { 8 | public string TenantId { get; set; } 9 | public bool IsDeleted { get; set; } = false; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationUserClaim.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | 4 | namespace MTShop.Core.Entities.Identity 5 | { 6 | public class ApplicationUserClaim : IdentityUserClaim 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationUserLogin.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Identity 4 | { 5 | public class ApplicationUserLogin : IdentityUserLogin 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationUserRole.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Identity 4 | { 5 | public class ApplicationUserRole : IdentityUserRole 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationUserRoleClaim.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Identity 4 | { 5 | public class ApplicationUserRoleClaim : IdentityRoleClaim 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Identity/ApplicationUserToken.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | 3 | namespace MTShop.Core.Entities.Identity 4 | { 5 | public class ApplicationUserToken : IdentityUserToken 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/Entities/Product.cs: -------------------------------------------------------------------------------- 1 |  2 | using MTShop.Core.Contracts; 3 | using MTShop.Core.Entities.Base; 4 | 5 | namespace MTShop.Core.Entities 6 | { 7 | public class Product : BaseEntity, IMustHaveTenant 8 | { 9 | public string Name { get; set; } 10 | public string Description { get; set; } 11 | public int Rate { get; set; } 12 | public string TenantId { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MultiTenant/MTShop.Core/MTShop.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ObserverPattern/GenericSolution/ObserverPattern/ObserverPattern.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ObserverPattern/StockNotification/StockNotifications/StockNotifications/StockNotifications.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PrivateRegistryDemo/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md 26 | !**/.gitignore 27 | !.git/HEAD 28 | !.git/config 29 | !.git/packed-refs 30 | !.git/refs/heads/** -------------------------------------------------------------------------------- /PrivateRegistryDemo/PrivateRegistryDemo/PrivateRegistryDemo.http: -------------------------------------------------------------------------------- 1 | @PrivateRegistryDemo_HostAddress = http://localhost:5133 2 | 3 | GET {{PrivateRegistryDemo_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /PrivateRegistryDemo/PrivateRegistryDemo/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace PrivateRegistryDemo 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateOnly Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /PrivateRegistryDemo/PrivateRegistryDemo/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /PrivateRegistryDemo/PrivateRegistryDemo/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # code-sample02 -------------------------------------------------------------------------------- /aks-hrm/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md 26 | !**/.gitignore 27 | !.git/HEAD 28 | !.git/config 29 | !.git/packed-refs 30 | !.git/refs/heads/** -------------------------------------------------------------------------------- /aks-hrm/HRM.API/Db/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace HRM.API.Db 5 | { 6 | public class ApplicationDbContext : DbContext 7 | { 8 | public ApplicationDbContext(DbContextOptions options) : base(options) 9 | { 10 | } 11 | 12 | public DbSet Employees { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /aks-hrm/HRM.API/Dockerfile_01: -------------------------------------------------------------------------------- 1 | # Use the official ASP.NET Core runtime image 2 | FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base 3 | WORKDIR /app 4 | EXPOSE 8080 5 | EXPOSE 8081 6 | 7 | # This stage is used to build the service project 8 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 9 | WORKDIR /src 10 | COPY . . 11 | RUN dotnet restore 12 | RUN dotnet publish -c Release -o /app 13 | 14 | # Final State 15 | FROM base AS final 16 | WORKDIR /app 17 | COPY --from=build /app . 18 | ENTRYPOINT ["dotnet", "HRM.API.dll"] -------------------------------------------------------------------------------- /aks-hrm/HRM.API/Dockerfile_02: -------------------------------------------------------------------------------- 1 | # Use the official ASP.NET Core runtime image 2 | FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base 3 | WORKDIR /app 4 | EXPOSE 8080 5 | EXPOSE 8081 6 | 7 | # This stage is used to build the service project 8 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 9 | WORKDIR /src 10 | COPY . . 11 | RUN dotnet restore 12 | RUN dotnet publish -c Release -o /app 13 | 14 | # Final State 15 | FROM base AS final 16 | WORKDIR /app 17 | COPY --from=build /app . 18 | ENTRYPOINT ["dotnet", "HRM.API.dll"] -------------------------------------------------------------------------------- /aks-hrm/HRM.API/HRM.API.http: -------------------------------------------------------------------------------- 1 | @HRM.API_HostAddress = http://localhost:5278 2 | 3 | GET {{HRM.API_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /aks-hrm/HRM.API/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace HRM.API.Models 2 | { 3 | public class Employee 4 | { 5 | public int Id { get; set; } 6 | public string FullName { get; set; } 7 | public string Designation { get; set; } 8 | public string Department { get; set; } 9 | public string Email { get; set; } 10 | public string Phone { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /aks-hrm/HRM.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace HRM.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateOnly Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /aks-hrm/HRM.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /aks-hrm/HRM.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Server=mahedeesqlserver.database.windows.net;Database=HRMDB;User Id=mahedee;Password=mypass@123;MultipleActiveResultSets=true" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/BFF.Web/Config/AlterUpstream.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace BFF.Web.Config 5 | { 6 | public class AlterUpstream 7 | { 8 | public static string AlterUpstreamSwaggerJson(HttpContext context, string swaggerJson) 9 | { 10 | var swagger = JObject.Parse(swaggerJson); 11 | // ... alter upstream json 12 | return swagger.ToString(Formatting.Indented); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/BFF.Web/Routes.dev/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "BaseUrl": "https://localhost:7205" 4 | //"ServiceDiscoveryProvider": { 5 | 6 | // "Host": "localhost", 7 | // "Port": 7205 8 | //} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/BFF.Web/Routes.prod/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "BaseUrl": "https://localhost:7205" 4 | //"ServiceDiscoveryProvider": { 5 | 6 | // "Host": "localhost", 7 | // "Port": 7205 8 | //} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/BFF.Web/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BFF.Web 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/BFF.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/BFF.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api-gateway-ocelot-qos/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/BFF.Web/BFF.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/BFF.Web/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BFF.Web 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/BFF.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/BFF.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Catalog.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Catalog.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Location.API/Controllers/CountriesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Location.API.Controllers 4 | { 5 | [ApiController] 6 | [Route("api/[controller]")] 7 | public class CountriesController : ControllerBase 8 | { 9 | [HttpGet("GetAll")] 10 | public IEnumerable Get() 11 | { 12 | return new string[] {"America","Bangladesh", "Canada" }; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Location.API/Location.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Location.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Location.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Location.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Location.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Ordering.API/Db/OrderingContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Ordering.API.Models; 3 | 4 | namespace Ordering.API.Db 5 | { 6 | public class OrderingContext : DbContext 7 | { 8 | public OrderingContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | public DbSet Order { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Ordering.API/Models/Order.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API.Models 2 | { 3 | public class Order 4 | { 5 | public int Id { get; set; } 6 | public string Address { get; set; } 7 | 8 | public DateTime OrderDate { get; set; } 9 | 10 | public string Comments { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Ordering.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api-gateway-ocelot/APIGateway/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /bootstrap-react-conversion/readme.txt: -------------------------------------------------------------------------------- 1 | https://blog.telexarsoftware.com/integrating-a-bootstrap-template-to-a-reactjs-application/ -------------------------------------------------------------------------------- /dotnet-core-nuget-github/CryptoTest/CryptoTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dotnet-core-nuget-github/CryptoTest/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using CryptoEngine; 4 | 5 | string plainText = "I am Mahedee"; 6 | Console.WriteLine("Plain Text: {0}", plainText); 7 | Console.WriteLine("Hash value: {0}", CryptoGenerator.GenerateSha256Hash(plainText)); -------------------------------------------------------------------------------- /generic-repo-uow/readme.txt: -------------------------------------------------------------------------------- 1 | Generic repository using unit of work pattern using angular -------------------------------------------------------------------------------- /health-check/HealthCheck/Admin.API/Admin.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Admin.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Admin.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /health-check/HealthCheck/Admin.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Admin.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Customer/Db/CustomerDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace Customer.API.Db 4 | { 5 | public class CustomerDbContext : DbContext 6 | { 7 | public CustomerDbContext(DbContextOptions options) : base(options) 8 | { 9 | 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Customer/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Customer 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /health-check/HealthCheck/Customer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Customer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "CustomerDBConnection": "Server=localhost;Database=Demo.CustomerDB;User Id=sa;Password=oLdViCtOrY2008;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Location.API/Persistence/LocationDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | 4 | namespace Location.API.Persistence 5 | { 6 | public class LocationDbContext : DbContext 7 | { 8 | public LocationDbContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Location.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Location.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /health-check/HealthCheck/Location.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Location.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "LocationDBConnection": "Server=localhost;Database=Demo.LocationDB;User Id=sa;Password=oLdViCtOrY2008;" 10 | }, 11 | "AllowedHosts": "*" 12 | } 13 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Product.API/Product.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Product.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Product.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /health-check/HealthCheck/Product.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /health-check/HealthCheck/Product.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /health-check/HealthCheck/WebStatus/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace WebStatus 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /health-check/HealthCheck/WebStatus/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /hrm/HRM/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/Db/HRMContext.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace HRM.API.Db 5 | { 6 | public class HRMContext : DbContext 7 | { 8 | public HRMContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | public DbSet Employees { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/Deploy/k8s/pod.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: hrm-pod 5 | labels: 6 | app: web-api 7 | 8 | spec: 9 | containers: 10 | - name: web-ctr 11 | image: docker.io/mahedee/hrm:1.0.1 12 | ports: 13 | - containerPort: 8011 -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace HRM.API.Models 2 | { 3 | public class Employee 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Designation { get; set; } 8 | public string FathersName { get; set; } 9 | public string MothersName { get; set; } 10 | public DateTime DateOfBirth { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/Repository/IEmployeeRepository.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | 3 | namespace HRM.API.Repository 4 | { 5 | public interface IEmployeeRepository 6 | { 7 | public Task> SelectAllEmployees(); 8 | public Task SelectEmployee(int id); 9 | public Task UpdateEmployee(int id, Employee employee); 10 | public Task SaveEmployee(Employee employee); 11 | public Task DeleteEmployee(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/Services/IEmployeeService.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | 3 | namespace HRM.API.Services 4 | { 5 | public interface IEmployeeService 6 | { 7 | public Task> GetEmployees(); 8 | public Task GetEmployee(int id); 9 | public Task EditEmployee(int id, Employee employee); 10 | public Task AddEmployee(Employee employee); 11 | public Task RemoveEmployee(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace HRM.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /hrm/HRM/HRM.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "6.0.3", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/Db/HRMContext.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace HRM.API.Db 5 | { 6 | public class HRMContext : DbContext 7 | { 8 | public HRMContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | public DbSet Employees { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace HRM.API.Models 2 | { 3 | public class Employee 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Designation { get; set; } 8 | public string FathersName { get; set; } 9 | public string MothersName { get; set; } 10 | public DateTime DateOfBirth { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/Repository/IEmployeeRepository.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | 3 | namespace HRM.API.Repository 4 | { 5 | public interface IEmployeeRepository 6 | { 7 | public Task> SelectAllEmployees(); 8 | public Task SelectEmployee(int id); 9 | public Task UpdateEmployee(int id, Employee employee); 10 | public Task SaveEmployee(Employee employee); 11 | public Task DeleteEmployee(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/Services/IEmployeeService.cs: -------------------------------------------------------------------------------- 1 | using HRM.API.Models; 2 | 3 | namespace HRM.API.Services 4 | { 5 | public interface IEmployeeService 6 | { 7 | public Task> GetEmployees(); 8 | public Task GetEmployee(int id); 9 | public Task EditEmployee(int id, Employee employee); 10 | public Task AddEmployee(Employee employee); 11 | public Task RemoveEmployee(int id); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace HRM.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /jenkins-demo/HRM/HRM.Test/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace HRM.Test 4 | { 5 | public class UnitTest1 6 | { 7 | [Fact] 8 | public void Test1() 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /kubernetes-demo/KubernetesDemo/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /kubernetes-demo/KubernetesDemo/Catalog.API/Db/CatalogDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace Catalog.API.Db 4 | { 5 | public class CatalogDbContext : DbContext 6 | { 7 | public CatalogDbContext(DbContextOptions options) : base(options) 8 | { 9 | 10 | } 11 | public DbSet Product { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /kubernetes-demo/KubernetesDemo/Catalog.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Catalog.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /kubernetes-demo/KubernetesDemo/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /kubernetes-demo/KubernetesDemo/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "DefaultConnection": "Server=192.168.7.154;Database=Demo.CustomerDB;User Id=sa;Password=oLdViCtOrY2008;" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /kubernetes-demo/KubernetesDemo/Catalog.API/deploy/k8s/pod.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: catalog-pod 5 | labels: 6 | app: web-api 7 | 8 | spec: 9 | containers: 10 | - name: web-ctr 11 | image: mahedee/catalog:1.0.4 12 | ports: 13 | - containerPort: 8011 14 | -------------------------------------------------------------------------------- /micro-frontend/customer-backend/Customers.API/Db/CustomersContext.cs: -------------------------------------------------------------------------------- 1 | using Customers.API.Model; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace Customers.API.Db 5 | { 6 | public class CustomersContext : DbContext 7 | { 8 | public CustomersContext(DbContextOptions options) 9 | : base(options) 10 | { 11 | 12 | } 13 | public DbSet Customers { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /micro-frontend/customer-backend/Customers.API/Model/Customer.cs: -------------------------------------------------------------------------------- 1 | namespace Customers.API.Model 2 | { 3 | public class Customer 4 | { 5 | public int Id { get; set; } 6 | public string? Name { get; set; } 7 | public string? PhoneNo { get; set;} 8 | public string? EmailAddress { get; set;} 9 | public DateTime? DOB { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /micro-frontend/customer-backend/Customers.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /micro-frontend/customer-backend/Customers.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/config-overrides.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webpack: (config, env) => { 3 | config.optimization.runtimeChunk = false; 4 | config.optimization.splitChunks = { 5 | cacheGroups: { 6 | default: false, 7 | }, 8 | }; 9 | 10 | config.output.filename = "static/js/[name].js"; 11 | 12 | config.plugins[5].options.filename = "static/css/[name].css"; 13 | config.plugins[5].options.moduleFilename = () => "static/css/main.css"; 14 | return config; 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/customer-frontend/public/favicon.ico -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/customer-frontend/public/logo192.png -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/customer-frontend/public/logo512.png -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .data-table { 2 | box-shadow: rgba(0, 0, 0, 0.25) 5px 5px 15px 0px; 3 | } -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/pages/CustomerPage.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import CustomersListComponent from "../components/CustomerComponent/CustomersListComponent"; 3 | 4 | const CustomerPage = () => { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default CustomerPage; 13 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/services/CustomerService.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { Base_URL_Customer } from "../utils/BaseUrl"; 3 | 4 | export const GetAllCustomers = (offset, pageSize, access_token) => { 5 | try { 6 | const response = axios.get(Base_URL_Customer + "/Customers"); 7 | return response; 8 | } catch (error) { 9 | throw error; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | module.exports = (app) => { 2 | app.use((req, res, next) => { 3 | res.header("Access-Control-Allow-Origin", "*"); 4 | next(); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/utils/BaseUrl.js: -------------------------------------------------------------------------------- 1 | export const Base_URL_Customer = "https://localhost:7154/api"; 2 | -------------------------------------------------------------------------------- /micro-frontend/customer-frontend/src/utils/Conversions.js: -------------------------------------------------------------------------------- 1 | export const convertDateFormat = (date) => { 2 | let convertedDate = new Date(date); 3 | return convertedDate.toDateString(); 4 | }; 5 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/config-overrides.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webpack: (config, env) => { 3 | config.optimization.runtimeChunk = false; 4 | config.optimization.splitChunks = { 5 | cacheGroups: { 6 | default: false, 7 | }, 8 | }; 9 | 10 | config.output.filename = "static/js/[name].js"; 11 | 12 | config.plugins[5].options.filename = "static/css/[name].css"; 13 | config.plugins[5].options.moduleFilename = () => "static/css/main.css"; 14 | return config; 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/header-frontend/public/favicon.ico -------------------------------------------------------------------------------- /micro-frontend/header-frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/header-frontend/public/logo192.png -------------------------------------------------------------------------------- /micro-frontend/header-frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/header-frontend/public/logo512.png -------------------------------------------------------------------------------- /micro-frontend/header-frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .App-header{ 2 | background-color: #4d739e; 3 | min-height: 3vh; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: center; 8 | font-size: calc(10px + 2vmin); 9 | color: white; 10 | 11 | box-shadow: rgba(0, 0, 0, 0.25) 0px 5px 15px; 12 | } -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import logo from "./logo.svg"; 2 | import "./App.css"; 3 | import { BrowserRouter } from "react-router-dom"; 4 | import Header from "./components/Header"; 5 | 6 | function App() { 7 | return ( 8 | 9 |
10 | 11 | ); 12 | } 13 | 14 | export default App; 15 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Container } from "react-bootstrap"; 3 | 4 | const Header = () => { 5 | return ( 6 | 7 |

Micro Frontend using React.js

8 |
9 | ); 10 | }; 11 | 12 | export default Header; 13 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | module.exports = (app) => { 2 | app.use((req, res, next) => { 3 | res.header("Access-Control-Allow-Origin", "*"); 4 | next(); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /micro-frontend/header-frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/.env: -------------------------------------------------------------------------------- 1 | REACT_APP_HEADER_HOST=http://localhost:3001 2 | REACT_APP_PRODUCT_HOST=http://localhost:3002 3 | REACT_APP_CUSTOMER_HOST=http://localhost:3003 -------------------------------------------------------------------------------- /micro-frontend/master-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/master-frontend/public/favicon.ico -------------------------------------------------------------------------------- /micro-frontend/master-frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/master-frontend/public/logo192.png -------------------------------------------------------------------------------- /micro-frontend/master-frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/master-frontend/public/logo512.png -------------------------------------------------------------------------------- /micro-frontend/master-frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | 15 | .sidenav---sidenav---_2tBP { 16 | background-color: #375a83 !important; 17 | } -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/micro-services/CustomerMicroServices.js: -------------------------------------------------------------------------------- 1 | import MicroFrontend from "../MicroFrontend"; 2 | 3 | const { REACT_APP_CUSTOMER_HOST: customerHost } = process.env; 4 | 5 | export function CustomerList({ history }) { 6 | return ( 7 | 8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/micro-services/LayoutMicroServices.js: -------------------------------------------------------------------------------- 1 | import MicroFrontend from "../MicroFrontend"; 2 | 3 | const { REACT_APP_HEADER_HOST: headerHost } = process.env; 4 | 5 | export function Header({ history }) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/micro-services/ProductMicroServices.js: -------------------------------------------------------------------------------- 1 | import MicroFrontend from "../MicroFrontend"; 2 | 3 | const { REACT_APP_PRODUCT_HOST: productHost } = process.env; 4 | 5 | export function ProductList({ history }) { 6 | return ; 7 | } 8 | 9 | export function CategoryList({ history }) { 10 | return ; 11 | } 12 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /micro-frontend/master-frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /micro-frontend/product-backend/Product.API/Db/ProductContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Product.API.Model; 3 | 4 | namespace Product.API.Db 5 | { 6 | public class ProductContext : DbContext 7 | { 8 | public ProductContext(DbContextOptions options) 9 | : base(options) 10 | { 11 | 12 | } 13 | public DbSet Products { get; set; } 14 | public DbSet Categories { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /micro-frontend/product-backend/Product.API/Model/Category.cs: -------------------------------------------------------------------------------- 1 | namespace Product.API.Model 2 | { 3 | public class Category 4 | { 5 | public int Id { get; set; } 6 | public string? Name { get; set; } 7 | public string? DisplayName { get; set;} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /micro-frontend/product-backend/Product.API/Model/Product.cs: -------------------------------------------------------------------------------- 1 | namespace Product.API.Model 2 | { 3 | public class Product 4 | { 5 | public int Id { get; set; } 6 | public string? Name { get; set; } 7 | public string? ShortName { get; set;} 8 | public double Price { get; set; } 9 | public DateTime? ManufactureDate { get; set; } 10 | public DateTime? ExpiryDate { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /micro-frontend/product-backend/Product.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /micro-frontend/product-backend/Product.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/config-overrides.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webpack: (config, env) => { 3 | config.optimization.runtimeChunk = false; 4 | config.optimization.splitChunks = { 5 | cacheGroups: { 6 | default: false, 7 | }, 8 | }; 9 | 10 | config.output.filename = "static/js/[name].js"; 11 | 12 | config.plugins[5].options.filename = "static/css/[name].css"; 13 | config.plugins[5].options.moduleFilename = () => "static/css/main.css"; 14 | return config; 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/product-frontend/public/favicon.ico -------------------------------------------------------------------------------- /micro-frontend/product-frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/product-frontend/public/logo192.png -------------------------------------------------------------------------------- /micro-frontend/product-frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/micro-frontend/product-frontend/public/logo512.png -------------------------------------------------------------------------------- /micro-frontend/product-frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .data-table { 2 | box-shadow: rgba(0, 0, 0, 0.25) 5px 5px 15px 0px; 3 | } -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/pages/CategoriesPage.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import GroupTypesListComponent from "../components/CategoryComponent/CategoryListComponent"; 3 | 4 | const CategoriesPage = () => { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default CategoriesPage; 13 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/pages/ProductsPage.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ProductListComponent from "../components/ProductComponent/ProductListComponent"; 3 | 4 | const ProductsPage = () => { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default ProductsPage; 13 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | module.exports = (app) => { 2 | app.use((req, res, next) => { 3 | res.header("Access-Control-Allow-Origin", "*"); 4 | next(); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/utils/BaseUrl.js: -------------------------------------------------------------------------------- 1 | export const Base_URL_Product = "https://localhost:7155/api"; 2 | -------------------------------------------------------------------------------- /micro-frontend/product-frontend/src/utils/Conversions.js: -------------------------------------------------------------------------------- 1 | export const convertDateFormat = (date) => { 2 | let convertedDate = new Date(date); 3 | return convertedDate.toDateString(); 4 | }; 5 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/BFF.Web/Config/AlterUpstream.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace BFF.Web.Config 5 | { 6 | public class AlterUpstream 7 | { 8 | public static string AlterUpstreamSwaggerJson(HttpContext context, string swaggerJson) 9 | { 10 | var swagger = JObject.Parse(swaggerJson); 11 | // ... alter upstream json 12 | return swagger.ToString(Formatting.Indented); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/BFF.Web/Routes/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "BaseUrl": "http://localhost:5205" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/BFF.Web/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BFF.Web 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/BFF.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/BFF.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Catalog.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Catalog.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Location.API/Controllers/CountriesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Location.API.Controllers 4 | { 5 | [ApiController] 6 | [Route("api/[controller]")] 7 | public class CountriesController : ControllerBase 8 | { 9 | [HttpGet("GetAll")] 10 | public IEnumerable Get() 11 | { 12 | return new string[] {"America","Bangladesh", "Canada" }; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Location.API/Location.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Location.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Location.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Location.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Location.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Ordering.API/Db/OrderingContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Ordering.API.Models; 3 | 4 | namespace Ordering.API.Db 5 | { 6 | public class OrderingContext : DbContext 7 | { 8 | public OrderingContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | public DbSet Order { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Ordering.API/Models/Order.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API.Models 2 | { 3 | public class Order 4 | { 5 | public int Id { get; set; } 6 | public string Address { get; set; } 7 | 8 | public DateTime OrderDate { get; set; } 9 | 10 | public string Comments { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Ordering.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ocelot-swagger/APIGateway/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /react-redux-toolkit/ECommerce/ECommerce.API/Db/ECommerceContext.cs: -------------------------------------------------------------------------------- 1 | using ECommerce.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace ECommerce.API.Db 5 | { 6 | public class ECommerceContext : DbContext 7 | { 8 | public ECommerceContext(DbContextOptions options) 9 | : base(options) 10 | { 11 | 12 | } 13 | public DbSet Products { get;set; } 14 | public DbSet Customers { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /react-redux-toolkit/ECommerce/ECommerce.API/Models/Customer.cs: -------------------------------------------------------------------------------- 1 | namespace ECommerce.API.Models 2 | { 3 | public class Customer 4 | { 5 | public int Id { get; set; } 6 | public string? FirstName { get; set; } 7 | public string? LastName { get; set; } 8 | public string? Email { get; set; } 9 | public string? Phone { get; set; } 10 | public DateTime BirthDate { get; set; } 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /react-redux-toolkit/ECommerce/ECommerce.API/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace ECommerce.API.Models 2 | { 3 | public class Product 4 | { 5 | public int Id { get; set; } 6 | public string? Name { get; set; } 7 | public string? Description { get; set; } 8 | public decimal Price { get; set; } 9 | public int StockQuantity { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /react-redux-toolkit/ECommerce/ECommerce.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ECommerce.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /react-redux-toolkit/ECommerce/ECommerce.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /react-redux-toolkit/ECommerce/ECommerce.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/.env: -------------------------------------------------------------------------------- 1 | PORT=3002 -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/react-redux-toolkit/redux-app/public/favicon.ico -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/react-redux-toolkit/redux-app/public/logo192.png -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/react-redux-toolkit/redux-app/public/logo512.png -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/config/BaseURL.js: -------------------------------------------------------------------------------- 1 | export const Base_URL = "https://localhost:7288/api"; 2 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/config/http-common.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { Base_URL } from "./BaseURL"; 3 | 4 | export default axios.create({ 5 | baseURL: Base_URL, 6 | headers: { 7 | "Content-type": "application/json", 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /react-redux-toolkit/redux-app/src/utils/Conversion.js: -------------------------------------------------------------------------------- 1 | export const convertDateFormat = (date) => { 2 | let convertedDate = new Date(date); 3 | return convertedDate.toDateString(); 4 | }; 5 | 6 | export const ConvertDateISOString = (date) => { 7 | return new Date(date).toISOString().slice(0, 10); 8 | }; 9 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Catalog.API/Db/CatalogContext.cs: -------------------------------------------------------------------------------- 1 | using Catalog.API.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace Catalog.API.Db 5 | { 6 | public class CatalogContext : DbContext 7 | { 8 | public CatalogContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | 13 | public DbSet CatalogItems { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Catalog.API/Db/catalog.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/saga-choreography/ECommerce/Catalog.API/Db/catalog.db -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "ConnectionStrings": { 10 | "DefaultConnection": "Data Source=db/catalog.db" 11 | }, 12 | "AllowedHosts": "*" 13 | } 14 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Ordering.API/Db/OrderingContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Ordering.API.Models; 3 | 4 | namespace Ordering.API.Db 5 | { 6 | public class OrderingContext : DbContext 7 | { 8 | public OrderingContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | 13 | public DbSet OrderItems { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Ordering.API/Db/ordering.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/saga-choreography/ECommerce/Ordering.API/Db/ordering.db -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Ordering.API/Db/ordering.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/saga-choreography/ECommerce/Ordering.API/Db/ordering.db-shm -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Ordering.API/Db/ordering.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/saga-choreography/ECommerce/Ordering.API/Db/ordering.db-wal -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "ConnectionStrings": { 10 | "DefaultConnection": "Data Source=db/ordering.db" 11 | }, 12 | 13 | "AllowedHosts": "*" 14 | } 15 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Shared/Models/CatalogResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Shared.Models 2 | { 3 | public class CatalogResponse 4 | { 5 | public int OrderId { get; set; } 6 | public int CatalogId { get; set; } 7 | public bool IsSuccess { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Shared/Models/OrderRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Shared.Models 2 | { 3 | public class OrderRequest 4 | { 5 | public int OrderId { get; set; } 6 | public int CatalogId { get; set; } 7 | public int Units { get; set; } 8 | public string Name { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /saga-choreography/ECommerce/Shared/Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sd-demo/BFF.Web/Config/AlterUpstream.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace BFF.Web.Config 5 | { 6 | public class AlterUpstream 7 | { 8 | public static string AlterUpstreamSwaggerJson(HttpContext context, string swaggerJson) 9 | { 10 | var swagger = JObject.Parse(swaggerJson); 11 | // ... alter upstream json 12 | return swagger.ToString(Formatting.Indented); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sd-demo/BFF.Web/Routes.dev/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "RequestIdKey": "OcRequestId", 4 | "DownstreamScheme": "http", 5 | "UseServiceDiscovery": true, 6 | "ServiceDiscoveryProvider": { 7 | "Host": "localhost", 8 | "Port": 8001, 9 | //Type can be Consul, Eureka 10 | "Type": "Eureka" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sd-demo/BFF.Web/Routes.prod/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "RequestIdKey": "OcRequestId", 4 | "DownstreamScheme": "http", 5 | "UseServiceDiscovery": true, 6 | "ServiceDiscoveryProvider": { 7 | "Host": "localhost", 8 | "Port": 8001, 9 | "Type": "Eureka" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sd-demo/BFF.Web/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BFF.Web 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-demo/BFF.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-demo/Customer.API/Customer.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sd-demo/Customer.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Customer.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-demo/Customer.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-demo/Location.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Location.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-demo/Location.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-demo/Product.API/Product.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sd-demo/Product.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Product.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-demo/Product.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-docker-demo/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /sd-docker-demo/BFF.Web/Config/AlterUpstream.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace BFF.Web.Config 5 | { 6 | public class AlterUpstream 7 | { 8 | public static string AlterUpstreamSwaggerJson(HttpContext context, string swaggerJson) 9 | { 10 | var swagger = JObject.Parse(swaggerJson); 11 | // ... alter upstream json 12 | return swagger.ToString(Formatting.Indented); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sd-docker-demo/BFF.Web/Routes.dev/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "RequestIdKey": "OcRequestId", 4 | "DownstreamScheme": "http", 5 | "UseServiceDiscovery": true, 6 | "ServiceDiscoveryProvider": { 7 | "Host": "bff.web", 8 | "Port": 80, 9 | //Type can be Consul, Eureka 10 | "Type": "Eureka" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sd-docker-demo/BFF.Web/Routes.prod/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "RequestIdKey": "OcRequestId", 4 | "DownstreamScheme": "http", 5 | "UseServiceDiscovery": true, 6 | "ServiceDiscoveryProvider": { 7 | "Host": "bff.web", 8 | "Port": 80, 9 | "Type": "Eureka" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sd-docker-demo/BFF.Web/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BFF.Web 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-docker-demo/BFF.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-docker-demo/LocationA.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace LocationA.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-docker-demo/LocationA.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-docker-demo/LocationB.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace LocationB.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-docker-demo/LocationB.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sd-docker-demo/LocationC.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace LocationC.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /sd-docker-demo/LocationC.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/BFF.Web/Config/AlterUpstream.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace BFF.Web.Config 5 | { 6 | public class AlterUpstream 7 | { 8 | public static string AlterUpstreamSwaggerJson(HttpContext context, string swaggerJson) 9 | { 10 | var swagger = JObject.Parse(swaggerJson); 11 | // ... alter upstream json 12 | return swagger.ToString(Formatting.Indented); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/BFF.Web/Routes/Routes.Dev/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "BaseUrl": "http://localhost:5205" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/BFF.Web/Routes/Routes.Prod/ocelot.global.json: -------------------------------------------------------------------------------- 1 | { 2 | "GlobalConfiguration": { 3 | "BaseUrl": "http://bffweb-service:8011" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/BFF.Web/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BFF.Web 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/BFF.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/BFF.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Catalog.API/Deploy/k8s/service.yml: -------------------------------------------------------------------------------- 1 | # Configure service 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: catalogapi-service 6 | spec: 7 | selector: 8 | app: catalogapi-pod 9 | ports: 10 | - port: 8001 11 | targetPort: 80 12 | type: LoadBalancer # use LoadBalancer if you want to accesss out side of pod -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Catalog.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Catalog.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Catalog.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Catalog.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Location.API/Controllers/CountriesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Location.API.Controllers 4 | { 5 | [ApiController] 6 | [Route("api/[controller]")] 7 | public class CountriesController : ControllerBase 8 | { 9 | [HttpGet("GetAll")] 10 | public IEnumerable Get() 11 | { 12 | return new string[] {"America","Bangladesh", "Canada" }; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Location.API/Deploy/k8s/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: locationapi-service 5 | spec: 6 | selector: 7 | app: locationapi-pod 8 | ports: 9 | - port: 8002 10 | targetPort: 80 11 | #type: LoadBalancer -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Location.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Location.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Location.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Location.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Ordering.API/Db/OrderingContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Ordering.API.Models; 3 | 4 | namespace Ordering.API.Db 5 | { 6 | public class OrderingContext : DbContext 7 | { 8 | public OrderingContext(DbContextOptions options) : base(options) 9 | { 10 | 11 | } 12 | public DbSet Order { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Ordering.API/Deploy/k8s/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: orderingapi-service 5 | spec: 6 | selector: 7 | app: orderingapi-pod 8 | ports: 9 | - port: 8003 10 | targetPort: 80 11 | type: LoadBalancer -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Ordering.API/Models/Order.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API.Models 2 | { 3 | public class Order 4 | { 5 | public int Id { get; set; } 6 | public string Address { get; set; } 7 | 8 | public DateTime OrderDate { get; set; } 9 | 10 | public string Comments { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Ordering.API/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.API 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /service-mesh/ServiceMesh/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /singleton-pattern/SingletonDemo/SingletonDemo/SingletonDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.API/Db/ordering.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core-react/ECommerce/Ordering.API/Db/ordering.db -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.API/Db/ordering.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core-react/ECommerce/Ordering.API/Db/ordering.db-shm -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.API/Db/ordering.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core-react/ECommerce/Ordering.API/Db/ordering.db-wal -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Data Source=db/ordering.db" 10 | }, 11 | "Jwt": { 12 | "Key": "$ecret@Key$shouldbeEncrypted!", 13 | "Issuer": "jwt", 14 | "Audience": "jwt", 15 | "ExpiryMinutes": 120 16 | }, 17 | 18 | "AllowedHosts": "*" 19 | } 20 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/Common/Exceptions/BadRequestException.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Common.Exceptions 2 | { 3 | public class BadRequestException : Exception 4 | { 5 | public BadRequestException() : base() 6 | { 7 | 8 | } 9 | 10 | public BadRequestException(string message) : base(message) 11 | { 12 | 13 | } 14 | 15 | public BadRequestException(string message, Exception exp) : base(message, exp) 16 | { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/Common/Exceptions/ForbiddenAccessException.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Common.Exceptions 2 | { 3 | public class ForbiddenAccessException : Exception 4 | { 5 | public ForbiddenAccessException() : base() { } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/Common/Interfaces/ITokenGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Common.Interfaces 2 | { 3 | public interface ITokenGenerator 4 | { 5 | //public string GenerateToken(string userName, string password); 6 | public string GenerateJWTToken((string userId, string userName, IList roles) userDetails); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/DTOs/AuthResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class AuthResponseDTO 4 | { 5 | public string UserId { get; set; } 6 | public string Name { get; set; } 7 | public string Token { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/DTOs/CustomerResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | // Customer response or DTO class 4 | public class CustomerResponse 5 | { 6 | public Int64 Id { get; set; } 7 | public string FirstName { get; set; } 8 | public string LastName { get; set; } 9 | public string Email { get; set; } 10 | public string ContactNumber { get; set; } 11 | public string Address { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/DTOs/RoleResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class RoleResponseDTO 4 | { 5 | public string Id { get; set; } 6 | public string RoleName { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/DTOs/UserDetailsResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class UserDetailsResponseDTO 4 | { 5 | public string Id { get; set; } 6 | public string FullName { get; set; } 7 | public string UserName { get; set; } 8 | public string Email { get; set; } 9 | public IList Roles { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Application/DTOs/UserResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class UserResponseDTO 4 | { 5 | public string Id { get; set; } 6 | public string FullName { get; set; } 7 | public string UserName { get; set; } 8 | public string Email { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Core/Entities/Customer.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities.Base; 2 | 3 | namespace Ordering.Core.Entities 4 | { 5 | // Customer entity 6 | public class Customer : BaseEntity 7 | { 8 | public string FirstName { get; set; } 9 | public string LastName { get; set; } 10 | public string Email { get; set; } 11 | public string ContactNumber { get; set; } 12 | public string Address { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Core/Ordering.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Core/Repositories/Command/Base/ICommandRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Ordering.Core.Repositories.Command.Base 4 | { 5 | // Generic interface for command repository 6 | public interface ICommandRepository where T : class 7 | { 8 | Task AddAsync(T entity); 9 | Task UpdateAsync(T entity); 10 | Task DeleteAsync(T entity); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Core/Repositories/Command/ICustomerCommandRepository.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities; 2 | using Ordering.Core.Repositories.Command.Base; 3 | 4 | namespace Ordering.Core.Repositories.Command 5 | { 6 | // Interface for customer command repository 7 | public interface ICustomerCommandRepository : ICommandRepository 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Core/Repositories/Query/Base/IQueryRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Core.Repositories.Query.Base 2 | { 3 | // Generic repository for query 4 | public interface IQueryRepository where T : class 5 | { 6 | // Generic repository for all if any 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Ordering.Infrastructure/Identity/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 |  2 | using Microsoft.AspNetCore.Identity; 3 | 4 | namespace Ordering.Infrastructure.Identity 5 | { 6 | public class ApplicationUser : IdentityUser 7 | { 8 | public string? FullName { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ECommerce/Readme.txt: -------------------------------------------------------------------------------- 1 | 1. Refactor - Follow Json Tylor Template -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/public/assets/config.js: -------------------------------------------------------------------------------- 1 | var baseURL = "https://localhost:7142/"; -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core-react/ecommerce.client/public/favicon.ico -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core-react/ecommerce.client/public/logo192.png -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core-react/ecommerce.client/public/logo512.png -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MemoryRouter } from 'react-router-dom'; 4 | import App from './App'; 5 | 6 | it('renders without crashing', async () => { 7 | const div = document.createElement('div'); 8 | ReactDOM.render( 9 | 10 | 11 | , div); 12 | await new Promise(resolve => setTimeout(resolve, 1000)); 13 | }); 14 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/components/Auth/Registration.js: -------------------------------------------------------------------------------- 1 | import { Component } from "react"; 2 | 3 | export default class Registration extends Component{ 4 | constructor(){ 5 | super(); 6 | this.state = { 7 | 8 | }; 9 | } 10 | 11 | render(){ 12 | return( 13 |

Create a new account

14 | ); 15 | } 16 | } -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/components/NavMenu.css: -------------------------------------------------------------------------------- 1 | a.navbar-brand { 2 | white-space: normal; 3 | text-align: center; 4 | word-break: break-all; 5 | } 6 | 7 | html { 8 | font-size: 14px; 9 | } 10 | @media (min-width: 768px) { 11 | html { 12 | font-size: 16px; 13 | } 14 | } 15 | 16 | .box-shadow { 17 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 18 | } 19 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/components/services/Settings.js: -------------------------------------------------------------------------------- 1 | export const BASE_URL = window.baseURL; 2 | 3 | //handle later on 4 | //export const LOGIN_STATUS = false; -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/custom.css: -------------------------------------------------------------------------------- 1 | /* Provide sufficient contrast against white background */ 2 | a { 3 | color: #0366d6; 4 | } 5 | 6 | code { 7 | color: #E01A76; 8 | } 9 | 10 | .btn-primary { 11 | color: #fff; 12 | background-color: #1b6ec2; 13 | border-color: #1861ac; 14 | } 15 | 16 | 17 | .checkBoxList{ 18 | list-style-type: none; 19 | padding-left: 0%; 20 | } -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /token-based-auth-core-react/ecommerce.client/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.API/Db/ordering.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core/ECommerce/Ordering.API/Db/ordering.db -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.API/Db/ordering.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core/ECommerce/Ordering.API/Db/ordering.db-shm -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.API/Db/ordering.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-core/ECommerce/Ordering.API/Db/ordering.db-wal -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Data Source=db/ordering.db" 10 | }, 11 | "Jwt": { 12 | "Key": "$ecret@Key$shouldbeEncrypted!", 13 | "Issuer": "jwt", 14 | "Audience": "jwt", 15 | "ExpiryMinutes": 120 16 | }, 17 | 18 | "AllowedHosts": "*" 19 | } 20 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/Common/Exceptions/BadRequestException.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Common.Exceptions 2 | { 3 | public class BadRequestException : Exception 4 | { 5 | public BadRequestException() : base() 6 | { 7 | 8 | } 9 | 10 | public BadRequestException(string message) : base(message) 11 | { 12 | 13 | } 14 | 15 | public BadRequestException(string message, Exception exp) : base(message, exp) 16 | { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/Common/Exceptions/ForbiddenAccessException.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Common.Exceptions 2 | { 3 | public class ForbiddenAccessException : Exception 4 | { 5 | public ForbiddenAccessException() : base() { } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/Common/Interfaces/ITokenGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.Common.Interfaces 2 | { 3 | public interface ITokenGenerator 4 | { 5 | //public string GenerateToken(string userName, string password); 6 | public string GenerateJWTToken((string userId, string userName, IList roles) userDetails); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/DTOs/AuthResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class AuthResponseDTO 4 | { 5 | public string UserId { get; set; } 6 | public string Name { get; set; } 7 | public string Token { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/DTOs/CustomerResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | // Customer response or DTO class 4 | public class CustomerResponse 5 | { 6 | public Int64 Id { get; set; } 7 | public string FirstName { get; set; } 8 | public string LastName { get; set; } 9 | public string Email { get; set; } 10 | public string ContactNumber { get; set; } 11 | public string Address { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/DTOs/RoleResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class RoleResponseDTO 4 | { 5 | public string Id { get; set; } 6 | public string RoleName { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/DTOs/UserDetailsResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class UserDetailsResponseDTO 4 | { 5 | public string Id { get; set; } 6 | public string FullName { get; set; } 7 | public string UserName { get; set; } 8 | public string Email { get; set; } 9 | public IList Roles { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Application/DTOs/UserResponseDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Application.DTOs 2 | { 3 | public class UserResponseDTO 4 | { 5 | public string Id { get; set; } 6 | public string FullName { get; set; } 7 | public string UserName { get; set; } 8 | public string Email { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Core/Entities/Customer.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities.Base; 2 | 3 | namespace Ordering.Core.Entities 4 | { 5 | // Customer entity 6 | public class Customer : BaseEntity 7 | { 8 | public string FirstName { get; set; } 9 | public string LastName { get; set; } 10 | public string Email { get; set; } 11 | public string ContactNumber { get; set; } 12 | public string Address { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Core/Ordering.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Core/Repositories/Command/Base/ICommandRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Ordering.Core.Repositories.Command.Base 4 | { 5 | // Generic interface for command repository 6 | public interface ICommandRepository where T : class 7 | { 8 | Task AddAsync(T entity); 9 | Task UpdateAsync(T entity); 10 | Task DeleteAsync(T entity); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Core/Repositories/Command/ICustomerCommandRepository.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities; 2 | using Ordering.Core.Repositories.Command.Base; 3 | 4 | namespace Ordering.Core.Repositories.Command 5 | { 6 | // Interface for customer command repository 7 | public interface ICustomerCommandRepository : ICommandRepository 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Core/Repositories/Query/Base/IQueryRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Core.Repositories.Query.Base 2 | { 3 | // Generic repository for query 4 | public interface IQueryRepository where T : class 5 | { 6 | // Generic repository for all if any 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-core/ECommerce/Ordering.Infrastructure/Identity/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 |  2 | using Microsoft.AspNetCore.Identity; 3 | 4 | namespace Ordering.Infrastructure.Identity 5 | { 6 | public class ApplicationUser : IdentityUser 7 | { 8 | public string? FullName { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.API/Db/ordering.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-ng/ECommerce/Ordering.API/Db/ordering.db -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.API/Db/ordering.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-ng/ECommerce/Ordering.API/Db/ordering.db-shm -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.API/Db/ordering.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahedee/code-sample02/4aa2c60a39fc75d3e4fcbd8a26c00cea6b3c9fdc/token-based-auth-ng/ECommerce/Ordering.API/Db/ordering.db-wal -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.API/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "DefaultConnection": "Data Source=db/ordering.db" 10 | }, 11 | "Jwt": { 12 | "Key": "$ecret@Key$shouldbeEncrypted!", 13 | "Issuer": "jwt", 14 | "Audience": "jwt", 15 | "ExpiryMinutes": 120 16 | }, 17 | 18 | "AllowedHosts": "*" 19 | } 20 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/Common/Exceptions/ForbiddenAccessException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ordering.Application.Common.Exceptions 8 | { 9 | public class ForbiddenAccessException : Exception 10 | { 11 | public ForbiddenAccessException() : base() { } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/Common/Interfaces/ITokenGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ordering.Application.Common.Interfaces 8 | { 9 | public interface ITokenGenerator 10 | { 11 | //public string GenerateToken(string userName, string password); 12 | public string GenerateJWTToken((string userId, string userName, IList roles) userDetails); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/DTOs/AuthResponseDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ordering.Application.DTOs 8 | { 9 | public class AuthResponseDTO 10 | { 11 | public string UserId { get; set; } 12 | public string Name { get; set; } 13 | public string Token { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/DTOs/CustomerResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Ordering.Application.DTOs 4 | { 5 | // Customer response or DTO class 6 | public class CustomerResponse 7 | { 8 | public Int64 Id { get; set; } 9 | public string FirstName { get; set; } 10 | public string LastName { get; set; } 11 | public string Email { get; set; } 12 | public string ContactNumber { get; set; } 13 | public string Address { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/DTOs/RoleResponseDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ordering.Application.DTOs 8 | { 9 | public class RoleResponseDTO 10 | { 11 | public string Id { get; set; } 12 | public string RoleName { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/DTOs/UserDetailsResponseDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ordering.Application.DTOs 8 | { 9 | public class UserDetailsResponseDTO 10 | { 11 | public string Id { get; set; } 12 | public string FullName { get; set; } 13 | public string UserName { get; set; } 14 | public string Email { get; set; } 15 | public IList Roles { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Application/DTOs/UserResponseDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ordering.Application.DTOs 8 | { 9 | public class UserResponseDTO 10 | { 11 | public string Id { get; set; } 12 | public string FullName { get; set; } 13 | public string UserName { get; set; } 14 | public string Email { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Core/Entities/Customer.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities.Base; 2 | 3 | namespace Ordering.Core.Entities 4 | { 5 | // Customer entity 6 | public class Customer : BaseEntity 7 | { 8 | public string FirstName { get; set; } 9 | public string LastName { get; set; } 10 | public string Email { get; set; } 11 | public string ContactNumber { get; set; } 12 | public string Address { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Core/Ordering.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Core/Repositories/Command/Base/ICommandRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Ordering.Core.Repositories.Command.Base 4 | { 5 | // Generic interface for command repository 6 | public interface ICommandRepository where T : class 7 | { 8 | Task AddAsync(T entity); 9 | Task UpdateAsync(T entity); 10 | Task DeleteAsync(T entity); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Core/Repositories/Command/ICustomerCommandRepository.cs: -------------------------------------------------------------------------------- 1 | using Ordering.Core.Entities; 2 | using Ordering.Core.Repositories.Command.Base; 3 | 4 | namespace Ordering.Core.Repositories.Command 5 | { 6 | // Interface for customer command repository 7 | public interface ICustomerCommandRepository : ICommandRepository 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Core/Repositories/Query/Base/IQueryRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Ordering.Core.Repositories.Query.Base 2 | { 3 | // Generic repository for query 4 | public interface IQueryRepository where T : class 5 | { 6 | // Generic repository for all if any 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Ordering.Infrastructure/Identity/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 |  2 | using Microsoft.AspNetCore.Identity; 3 | 4 | namespace Ordering.Infrastructure.Identity 5 | { 6 | public class ApplicationUser : IdentityUser 7 | { 8 | public string? FullName { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /token-based-auth-ng/ECommerce/Readme.txt: -------------------------------------------------------------------------------- 1 | 1. Refactor - Follow Json Tylor Template -------------------------------------------------------------------------------- /token-based-auth-ng/readme.txt: -------------------------------------------------------------------------------- 1 | Generic repository using unit of work pattern using angular --------------------------------------------------------------------------------