├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── LICENSE ├── README.md └── src ├── AspNetCore └── RxWeb.Core.AspNetCore │ ├── Abstract │ ├── BaseChildController.cs │ ├── BaseController.cs │ ├── BaseDomainCollectionController.cs │ ├── BaseDomainController.cs │ └── BaseLookupController.cs │ ├── Binder │ └── QueryParamsBinder.cs │ ├── Extensions │ └── ApplicationExtensions.cs │ └── RxWeb.Core.AspNetCore.csproj ├── AzureFunction └── RxWeb.Core.AzureFunction │ ├── Abstract │ ├── BaseChildController.cs │ ├── BaseController.cs │ ├── BaseDomainController.cs │ └── BaseLookupController.cs │ └── RxWeb.Core.AzureFunction.csproj ├── CleanArchitecture ├── Api │ ├── Api.csproj │ ├── Bootstrap │ │ ├── AddDbContext.cs │ │ ├── ConfigurationOptions.cs │ │ ├── Performance.cs │ │ ├── Scoped.cs │ │ ├── Security.cs │ │ ├── Singleton.cs │ │ └── Swagger.cs │ ├── Controllers │ │ └── Api │ │ │ └── Core │ │ │ ├── AuthenticationController.cs │ │ │ └── AuthorizeController.cs │ ├── Program.cs │ ├── Startup.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── web.config ├── BoundedContext │ ├── BoundedContext.csproj │ ├── DbContext │ │ └── Main │ │ │ └── LoginContext.cs │ ├── Singleton │ │ └── TenantDbConnectionInfo.cs │ └── SqlDbContext │ │ ├── LogSqlDbContext.cs │ │ └── MainSqlDbContext.cs ├── CleanArchitecture.sln ├── Domain │ └── Domain.csproj ├── Infrastructure │ ├── Infrastructure.csproj │ ├── Security │ │ ├── ApplicationTokenProvider.cs │ │ ├── Authorization │ │ │ └── AccessPermissionHandler.cs │ │ └── TokenAuthorizer.cs │ └── Singleton │ │ └── UserAccessConfigInfo.cs ├── Models │ ├── DbEntities │ │ └── Main │ │ │ ├── ApplicationLocale.cs │ │ │ ├── ApplicationModule.cs │ │ │ ├── ApplicationObject.cs │ │ │ ├── ApplicationObjectType.cs │ │ │ ├── ApplicationTimeZone.cs │ │ │ ├── ApplicationUserToken.cs │ │ │ ├── ComponentLanguageContent.cs │ │ │ ├── LanguageContent.cs │ │ │ ├── LanguageContentKey.cs │ │ │ ├── ModuleMaster.cs │ │ │ ├── Role.cs │ │ │ ├── RolePermission.cs │ │ │ ├── User.cs │ │ │ ├── UserRole.cs │ │ │ └── vUser.cs │ ├── Enums │ │ └── Main │ │ │ └── Status.cs │ ├── Interface │ │ ├── ILogDatabaseFacade.cs │ │ └── IMainDatabaseFacade.cs │ ├── Models.csproj │ ├── Models │ │ └── SecurityConfig.cs │ └── ViewModels │ │ ├── AuthenticationModel.cs │ │ ├── StoreProcResult.cs │ │ └── UserConfig.cs ├── UnitOfWork │ ├── BaseUow.cs │ ├── DbEntityAudit │ │ └── AuditLog.cs │ ├── Main │ │ └── LoginUow.cs │ └── UnitOfWork.csproj ├── azure-pipelines.yml └── rxweb-tool │ ├── config.json │ ├── models.log.json │ └── models.main.json ├── Common ├── RxWeb.Core.Annotations │ ├── Attributes │ │ └── ModelValidation.cs │ ├── Constants │ │ └── ApplicationConstants.cs │ ├── Conventions │ │ └── ModelValidationFilterConvention.cs │ ├── Domain │ │ └── ModelValidation.cs │ ├── Enums │ │ └── SqlQueryOperator.cs │ ├── Extensions │ │ ├── ApplicationExtensions.cs │ │ └── MvcOptionExtensions.cs │ ├── Factory │ │ └── ModelValidationFilterFactory.cs │ ├── Filters │ │ └── ModelValidationFilter.cs │ ├── Interface │ │ ├── IDatabaseFacade.cs │ │ ├── ILocalizationInfo.cs │ │ ├── IModelValidation.cs │ │ └── IValidator.cs │ ├── Models │ │ ├── UniqueQuery.cs │ │ ├── ValidationMessageConfig.cs │ │ └── ValidationResultModel.cs │ ├── RxWeb.Core.Annotations.csproj │ └── Validators │ │ ├── BaseValidationAttribute.cs │ │ ├── HardDeleteAttribute.cs │ │ ├── MaxLengthAttribute.cs │ │ ├── RangeAttribute.cs │ │ ├── RequiredAttribute.cs │ │ └── UniqueAttribute.cs ├── RxWeb.Core.Cache │ ├── Filters │ │ ├── CacheETag.cs │ │ ├── Cacheable.cs │ │ └── NoCacheable.cs │ ├── Models │ │ └── TagCache.cs │ └── RxWeb.Core.Cache.csproj ├── RxWeb.Core.Common │ ├── Email │ │ ├── MailKitEmail.cs │ │ ├── SendGridEmail.cs │ │ └── StandardEmail.cs │ ├── Enums │ │ └── EmailFormatType.cs │ ├── Extensions │ │ ├── EmailServiceExtension.cs │ │ └── SmsServiceExtension.cs │ ├── Interface │ │ ├── IEmail.cs │ │ └── ITextSms.cs │ ├── Models │ │ ├── MailConfig.cs │ │ ├── MailKitEmailConfiguration.cs │ │ ├── SendGridEmailConfiguration.cs │ │ ├── SmsConfig.cs │ │ ├── StandardEmailConfiguration.cs │ │ └── TwilioSmsConfiguration.cs │ ├── RxWeb.Core.Common.csproj │ └── Sms │ │ └── TwilioSms.cs ├── RxWeb.Core.Localization │ ├── Core │ │ └── LocalizationInfo.cs │ ├── Extensions │ │ └── LocalizationExtensions.cs │ ├── RxWeb.Core.Localization.csproj │ └── Singleton │ │ └── ApplicationLocalizationInfo.cs ├── RxWeb.Core.Logging │ ├── Extensions │ │ ├── LoggingExtensions.cs │ │ └── MvcOptionExtensions.cs │ ├── Filters │ │ └── RequestTracingFilter.cs │ ├── Logging │ │ ├── ExceptionLog.cs │ │ └── RequestLog.cs │ ├── Models │ │ └── TraceRequest.cs │ └── RxWeb.Core.Logging.csproj ├── RxWeb.Core.Repository │ ├── Annotations │ │ ├── CompositeKeyAttribute.cs │ │ ├── DefaultSchema.cs │ │ ├── GlobalQueryFilterAttribute.cs │ │ ├── HasOneAttribute.cs │ │ ├── KeyLessEntityAttribute.cs │ │ ├── LogPropertyAttribute.cs │ │ ├── NotNullableAttribute.cs │ │ ├── PrimaryTextColumnAttribute.cs │ │ ├── RecordLogAttribute.cs │ │ ├── RelationShipTable.cs │ │ ├── SharedKeyAttribute.cs │ │ ├── TableKeyAttribute.cs │ │ ├── TenantQueryFilterAttribute.cs │ │ ├── TimeZoneConversionAttribute.cs │ │ └── ValueConversionAttribute.cs │ ├── Audit │ │ ├── AbstractDbQuery.cs │ │ └── EntityAudit.cs │ ├── BoundedContext │ │ ├── BaseBoundedContext.cs │ │ └── BaseContext.cs │ ├── Const │ │ └── CustomClaimTypes.cs │ ├── Core │ │ ├── CoreUnitOfWork.cs │ │ ├── DbContextManager.cs │ │ ├── InstanceRepository.cs │ │ ├── Repository.cs │ │ ├── RepositoryProvider.cs │ │ └── Utilities.cs │ ├── Extensions │ │ ├── CompositeKeyExtension.cs │ │ ├── GlobalFilterQueryExtension.cs │ │ ├── HasOneExtension.cs │ │ ├── KeyLessEntityExtension.cs │ │ ├── SqlDbContextOptionExtensions.cs │ │ ├── TableSchemaModiferExtension.cs │ │ └── ValueConversionExtension.cs │ ├── Interface │ │ ├── IAuditLog.cs │ │ ├── IConcurrencyException.cs │ │ ├── ICoreUnitOfWork.cs │ │ ├── IDbContext.cs │ │ ├── IDbContextManager.cs │ │ ├── IRepository.cs │ │ ├── IRepositoryProvider.cs │ │ ├── ISqlDbContext.cs │ │ ├── ITenantDbConnectionInfo.cs │ │ ├── ITimeZoneConverter.cs │ │ └── IValueConverter.cs │ ├── Models │ │ ├── CoreAuditRecord.cs │ │ ├── CoreAuditRecordDetail.cs │ │ ├── CoreAuditRequest.cs │ │ ├── DatabaseBased.cs │ │ ├── DatabaseConfig.cs │ │ ├── MultiTenantConfig.cs │ │ └── SchemaBased.cs │ ├── RxWeb.Core.Data.csproj │ └── Singleton │ │ └── TimeZoneValueProvider.cs ├── RxWeb.Core.Sanitizers │ ├── Enums │ │ ├── ActionValueType.cs │ │ └── RequestActionType.cs │ ├── Extensions │ │ ├── MvcOptionExtensions.cs │ │ └── SanitizerExtensions.cs │ ├── Formatters │ │ └── InputJsonFormatter.cs │ ├── Interface │ │ ├── BaseSanitizeConfig.cs │ │ ├── IActionSanitizer.cs │ │ ├── ISanitize.cs │ │ ├── ISanitizer.cs │ │ └── SanitizeConfig.cs │ ├── RxWeb.Core.Sanitizers.csproj │ └── Sanitizers │ │ ├── EntitySanitizer.cs │ │ ├── EscapeText.cs │ │ ├── FromBase64String.cs │ │ ├── OnPost.cs │ │ └── ToLower.cs ├── RxWeb.Core.Security │ ├── Authorization │ │ ├── AccessAtributeInfo.cs │ │ ├── AccessAttribute.cs │ │ ├── AccessPermissionRequirement.cs │ │ ├── AccessPolicyProvider.cs │ │ └── AuthorizationPermissionHandler.cs │ ├── Cryptography │ │ ├── PasswordHash.cs │ │ └── PasswordHashResult.cs │ ├── Extensions │ │ └── RxwebSecurityExtensions.cs │ ├── Filters │ │ ├── ActiveSessionFilter.cs │ │ ├── AllowAnonymousUser.cs │ │ └── AllowRequest.cs │ ├── Interface │ │ ├── IAccessPermissionHandler.cs │ │ ├── IJwtTokenProvider.cs │ │ ├── ITokenAuthorizer.cs │ │ └── IUserClaim.cs │ ├── JwtToken │ │ └── JwtTokenProvider.cs │ ├── RxWeb.Core.Security.csproj │ └── Singleton │ │ ├── PolicyProviderAdditionalValue.cs │ │ └── UserClaim.cs └── RxWeb.Core │ ├── Interface │ ├── ICoreCollectionDomain.cs │ ├── ICoreDomain.cs │ └── ICorePatchDomain.cs │ └── RxWeb.Core.csproj ├── ProjectTemplates └── AspNetCore │ ├── Project Template │ └── CleanArchitecture │ │ ├── Api │ │ ├── Api.csproj │ │ ├── Api.vstemplate │ │ ├── Bootstrap │ │ │ ├── AddDbContext.cs │ │ │ ├── ConfigurationOptions.cs │ │ │ ├── Performance.cs │ │ │ ├── Scoped.cs │ │ │ ├── Security.cs │ │ │ ├── Singleton.cs │ │ │ └── Swagger.cs │ │ ├── Controllers │ │ │ └── Api │ │ │ │ └── Core │ │ │ │ ├── AuthenticationController.cs │ │ │ │ └── AuthorizeController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── web.config │ │ ├── BoundedContext │ │ ├── BoundedContext.csproj │ │ ├── BoundedContext.vstemplate │ │ ├── DbContext │ │ │ └── Main │ │ │ │ └── LoginContext.cs │ │ ├── Singleton │ │ │ └── TenantDbConnectionInfo.cs │ │ └── SqlDbContext │ │ │ ├── LogSqlDbContext.cs │ │ │ └── MainSqlDbContext.cs │ │ ├── CleanArchitecture.vstemplate │ │ ├── Domain │ │ ├── Domain.csproj │ │ └── Domain.vstemplate │ │ ├── Infrastructure │ │ ├── Infrastructure.csproj │ │ ├── Infrastructure.vstemplate │ │ ├── Security │ │ │ ├── ApplicationTokenProvider.cs │ │ │ ├── Authorization │ │ │ │ └── AccessPermissionHandler.cs │ │ │ └── TokenAuthorizer.cs │ │ └── Singleton │ │ │ └── UserAccessConfigInfo.cs │ │ ├── Models │ │ ├── DbEntities │ │ │ └── Main │ │ │ │ ├── ApplicationLocale.cs │ │ │ │ ├── ApplicationModule.cs │ │ │ │ ├── ApplicationObject.cs │ │ │ │ ├── ApplicationObjectType.cs │ │ │ │ ├── ApplicationTimeZone.cs │ │ │ │ ├── ApplicationUserToken.cs │ │ │ │ ├── ComponentLanguageContent.cs │ │ │ │ ├── LanguageContent.cs │ │ │ │ ├── LanguageContentKey.cs │ │ │ │ ├── ModuleMaster.cs │ │ │ │ ├── Role.cs │ │ │ │ ├── RolePermission.cs │ │ │ │ ├── User.cs │ │ │ │ ├── UserRole.cs │ │ │ │ └── vUser.cs │ │ ├── Enums │ │ │ └── Main │ │ │ │ └── Status.cs │ │ ├── Interface │ │ │ ├── ILogDatabaseFacade.cs │ │ │ └── IMainDatabaseFacade.cs │ │ ├── Models.csproj │ │ ├── Models.vstemplate │ │ ├── Models │ │ │ └── SecurityConfig.cs │ │ └── ViewModels │ │ │ ├── AuthenticationModel.cs │ │ │ ├── StoreProcResult.cs │ │ │ └── UserConfig.cs │ │ ├── UnitOfWork │ │ ├── BaseUow.cs │ │ ├── DbEntityAudit │ │ │ └── AuditLog.cs │ │ ├── Main │ │ │ └── LoginUow.cs │ │ ├── UnitOfWork.csproj │ │ └── UnitOfWork.vstemplate │ │ └── icon.png │ └── cli │ ├── CleanArchitecture │ ├── .template.config │ │ ├── icon.png │ │ └── template.json │ ├── CleanArchitecture.Api │ │ ├── Bootstrap │ │ │ ├── AddDbContext.cs │ │ │ ├── ConfigurationOptions.cs │ │ │ ├── Performance.cs │ │ │ ├── Scoped.cs │ │ │ ├── Security.cs │ │ │ ├── Singleton.cs │ │ │ └── Swagger.cs │ │ ├── CleanArchitecture.Api.csproj │ │ ├── Controllers │ │ │ └── Api │ │ │ │ └── Core │ │ │ │ ├── AuthenticationController.cs │ │ │ │ └── AuthorizeController.cs │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── web.config │ ├── CleanArchitecture.BoundedContext │ │ ├── CleanArchitecture.BoundedContext.csproj │ │ ├── DbContext │ │ │ └── Main │ │ │ │ └── LoginContext.cs │ │ ├── Singleton │ │ │ └── TenantDbConnectionInfo.cs │ │ └── SqlDbContext │ │ │ ├── LogSqlDbContext.cs │ │ │ └── MainSqlDbContext.cs │ ├── CleanArchitecture.Domain │ │ └── CleanArchitecture.Domain.csproj │ ├── CleanArchitecture.Infrastructure │ │ ├── CleanArchitecture.Infrastructure.csproj │ │ ├── Security │ │ │ ├── ApplicationTokenProvider.cs │ │ │ ├── Authorization │ │ │ │ └── AccessPermissionHandler.cs │ │ │ └── TokenAuthorizer.cs │ │ └── Singleton │ │ │ └── UserAccessConfigInfo.cs │ ├── CleanArchitecture.Models │ │ ├── CleanArchitecture.Models.csproj │ │ ├── DbEntities │ │ │ └── Main │ │ │ │ ├── ApplicationLocale.cs │ │ │ │ ├── ApplicationModule.cs │ │ │ │ ├── ApplicationObject.cs │ │ │ │ ├── ApplicationObjectType.cs │ │ │ │ ├── ApplicationTimeZone.cs │ │ │ │ ├── ApplicationUserToken.cs │ │ │ │ ├── ComponentLanguageContent.cs │ │ │ │ ├── LanguageContent.cs │ │ │ │ ├── LanguageContentKey.cs │ │ │ │ ├── ModuleMaster.cs │ │ │ │ ├── Role.cs │ │ │ │ ├── RolePermission.cs │ │ │ │ ├── User.cs │ │ │ │ ├── UserRole.cs │ │ │ │ └── vUser.cs │ │ ├── Enums │ │ │ └── Main │ │ │ │ └── Status.cs │ │ ├── Interface │ │ │ ├── ILogDatabaseFacade.cs │ │ │ └── IMainDatabaseFacade.cs │ │ ├── Models │ │ │ └── SecurityConfig.cs │ │ └── ViewModels │ │ │ ├── AuthenticationModel.cs │ │ │ ├── StoreProcResult.cs │ │ │ └── UserConfig.cs │ ├── CleanArchitecture.UnitOfWork │ │ ├── BaseUow.cs │ │ ├── CleanArchitecture.UnitOfWork.csproj │ │ ├── DbEntityAudit │ │ │ └── AuditLog.cs │ │ └── Main │ │ │ └── LoginUow.cs │ ├── CleanArchitecture.sln │ └── icon.png │ ├── clean.architecture.aspnetcore.csproj │ ├── clean.architecture.aspnetcore.sln │ └── icon.png ├── RxWebCoreSample ├── NewProjectSolution.Api │ ├── Bootstrap │ │ ├── AddDbContext.cs │ │ ├── ConfigurationOptions.cs │ │ ├── Performance.cs │ │ ├── Scoped.cs │ │ ├── Security.cs │ │ ├── Singleton.cs │ │ └── Swagger.cs │ ├── Controllers │ │ └── Api │ │ │ └── Core │ │ │ ├── AuthenticationController.cs │ │ │ └── AuthorizeController.cs │ ├── NewProjectSolution.Api.csproj │ ├── Program.cs │ ├── Startup.cs │ ├── appsettings.json │ ├── web.config │ └── wwwroot │ │ ├── localization.rar │ │ └── localization │ │ ├── AppComponent-en.json │ │ ├── AppComponent-fr.json │ │ ├── global-en.json │ │ ├── global-fr.json │ │ ├── master.activity-log-types.list-en.json │ │ └── master.activity-log-types.list-fr.json ├── NewProjectSolution.BoundedContext │ ├── DbContext │ │ └── Main │ │ │ ├── LoginContext.cs │ │ │ └── MasterContext.cs │ ├── NewProjectSolution.BoundedContext.csproj │ ├── Singleton │ │ └── TenantDbConnectionInfo.cs │ └── SqlDbContext │ │ ├── LogSqlDbContext.cs │ │ └── MainSqlDbContext.cs ├── NewProjectSolution.Domain │ └── NewProjectSolution.Domain.csproj ├── NewProjectSolution.Infrastructure │ ├── NewProjectSolution.Infrastructure.csproj │ ├── Security │ │ ├── ApplicationTokenProvider.cs │ │ ├── Authorization │ │ │ └── AccessPermissionHandler.cs │ │ └── TokenAuthorizer.cs │ └── Singleton │ │ └── UserAccessConfigInfo.cs ├── NewProjectSolution.Models │ ├── DbEntities │ │ └── Main │ │ │ ├── ApplicationLocale.cs │ │ │ ├── ApplicationModule.cs │ │ │ ├── ApplicationObject.cs │ │ │ ├── ApplicationObjectType.cs │ │ │ ├── ApplicationTimeZone.cs │ │ │ ├── ApplicationUserToken.cs │ │ │ ├── ComponentLanguageContent.cs │ │ │ ├── LanguageContent.cs │ │ │ ├── LanguageContentKey.cs │ │ │ ├── ModuleMaster.cs │ │ │ ├── Person.cs │ │ │ ├── Role.cs │ │ │ ├── RolePermission.cs │ │ │ ├── User.cs │ │ │ ├── UserRole.cs │ │ │ └── vUser.cs │ ├── Enums │ │ └── Main │ │ │ └── Status.cs │ ├── Interface │ │ ├── ILogDatabaseFacade.cs │ │ └── IMainDatabaseFacade.cs │ ├── Models │ │ └── SecurityConfig.cs │ ├── NewProjectSolution.Models.csproj │ └── ViewModels │ │ ├── AuthenticationModel.cs │ │ ├── StoreProcResult.cs │ │ └── UserConfig.cs ├── NewProjectSolution.UnitOfWork │ ├── BaseUow.cs │ ├── DbEntityAudit │ │ └── AuditLog.cs │ ├── Main │ │ ├── LoginUow.cs │ │ └── MasterUow.cs │ └── NewProjectSolution.UnitOfWork.csproj ├── NewProjectSolution.sln └── rxweb-tool │ ├── config.json │ ├── controllers.main.json │ ├── models.log.json │ └── models.main.json ├── Samples └── AspNetCore │ └── Documentation Examples │ ├── HumanResourceApplication │ ├── HumanResourceApplication.Api │ │ ├── Bootstrap │ │ │ ├── AddDbContext.cs │ │ │ ├── ConfigurationOptions.cs │ │ │ ├── Performance.cs │ │ │ ├── Scoped.cs │ │ │ ├── Security.cs │ │ │ ├── Singleton.cs │ │ │ └── Swagger.cs │ │ ├── Controllers │ │ │ └── Api │ │ │ │ ├── CandidateModule │ │ │ │ ├── CandidateAvailabilitiesController.cs │ │ │ │ └── CandidatesController.cs │ │ │ │ ├── Core │ │ │ │ ├── AuthenticationController.cs │ │ │ │ └── AuthorizeController.cs │ │ │ │ ├── Lookups │ │ │ │ └── Main │ │ │ │ │ └── CountryLookupsController.cs │ │ │ │ ├── Search │ │ │ │ └── Main │ │ │ │ │ └── UsersSearchController.cs │ │ │ │ └── UserModule │ │ │ │ └── UsersController.cs │ │ ├── HumanResourceApplication.Api.csproj │ │ ├── Program.cs │ │ ├── Startup.cs │ │ ├── appsettings.json │ │ └── web.config │ ├── HumanResourceApplication.BoundedContext │ │ ├── DbContext │ │ │ └── Main │ │ │ │ ├── CandidateContext.cs │ │ │ │ ├── CandidateLookupContext.cs │ │ │ │ ├── LoginContext.cs │ │ │ │ └── UserContext.cs │ │ ├── HumanResourceApplication.BoundedContext.csproj │ │ ├── Singleton │ │ │ └── TenantDbConnectionInfo.cs │ │ └── SqlDbContext │ │ │ ├── LogSqlDbContext.cs │ │ │ └── MainSqlDbContext.cs │ ├── HumanResourceApplication.Domain │ │ ├── HumanResourceApplication.Domain.csproj │ │ └── UserDomain │ │ │ └── UserDomain.cs │ ├── HumanResourceApplication.Infrastructure │ │ ├── HumanResourceApplication.Infrastructure.csproj │ │ ├── Security │ │ │ ├── ApplicationTokenProvider.cs │ │ │ ├── Authorization │ │ │ │ └── AccessPermissionHandler.cs │ │ │ └── TokenAuthorizer.cs │ │ └── Singleton │ │ │ └── UserAccessConfigInfo.cs │ ├── HumanResourceApplication.Models │ │ ├── DbEntities │ │ │ └── Main │ │ │ │ ├── ApplicationLocale.cs │ │ │ │ ├── ApplicationModule.cs │ │ │ │ ├── ApplicationObject.cs │ │ │ │ ├── ApplicationObjectType.cs │ │ │ │ ├── ApplicationTimeZone.cs │ │ │ │ ├── ApplicationUserToken.cs │ │ │ │ ├── Candidate.cs │ │ │ │ ├── CandidateAvailability.cs │ │ │ │ ├── ComponentLanguageContent.cs │ │ │ │ ├── Country.cs │ │ │ │ ├── LanguageContent.cs │ │ │ │ ├── LanguageContentKey.cs │ │ │ │ ├── ModuleMaster.cs │ │ │ │ ├── Role.cs │ │ │ │ ├── RolePermission.cs │ │ │ │ ├── State.cs │ │ │ │ ├── User.cs │ │ │ │ ├── UserRole.cs │ │ │ │ ├── vCandidate.cs │ │ │ │ ├── vCandidateRecord.cs │ │ │ │ ├── vCountryLookup.cs │ │ │ │ ├── vStateRecord.cs │ │ │ │ └── vUser.cs │ │ ├── Enums │ │ │ └── Main │ │ │ │ └── Status.cs │ │ ├── ExtendedModels │ │ │ └── Main │ │ │ │ └── EncryptDecryptConverter.cs │ │ ├── HumanResourceApplication.Models.csproj │ │ ├── Interface │ │ │ ├── ILogDatabaseFacade.cs │ │ │ └── IMainDatabaseFacade.cs │ │ ├── Models │ │ │ └── SecurityConfig.cs │ │ └── ViewModels │ │ │ ├── AuthenticationModel.cs │ │ │ ├── StoreProcResult.cs │ │ │ └── UserConfig.cs │ ├── HumanResourceApplication.UnitOfWork │ │ ├── BaseUow.cs │ │ ├── DbEntityAudit │ │ │ └── AuditLog.cs │ │ ├── HumanResourceApplication.UnitOfWork.csproj │ │ └── Main │ │ │ ├── CandidateLookupUow.cs │ │ │ ├── CandidateUow.cs │ │ │ ├── LoginUow.cs │ │ │ └── UserUow.cs │ ├── HumanResourceApplication.sln │ ├── Scripts │ │ ├── humanresource-log.sql │ │ └── humanresource.sql │ ├── rxweb-tool │ │ ├── config.json │ │ ├── controllers.main.json │ │ ├── lookups.main.json │ │ └── models.main.json │ └── src │ │ └── app │ │ ├── collections │ │ └── status.collection.ts │ │ ├── enums │ │ └── status.enum.ts │ │ ├── models │ │ ├── database-models │ │ │ ├── application-locale-base.ts │ │ │ ├── application-module-base.ts │ │ │ ├── application-object-base.ts │ │ │ ├── application-object-type-base.ts │ │ │ ├── application-time-zone-base.ts │ │ │ ├── application-user-token-base.ts │ │ │ ├── candidate-availability-base.ts │ │ │ ├── candidate-base.ts │ │ │ ├── component-language-content-base.ts │ │ │ ├── country-base.ts │ │ │ ├── index.ts │ │ │ ├── language-content-base.ts │ │ │ ├── language-content-key-base.ts │ │ │ ├── module-master-base.ts │ │ │ ├── role-base.ts │ │ │ ├── role-permission-base.ts │ │ │ ├── state-base.ts │ │ │ ├── user-base.ts │ │ │ ├── user-role-base.ts │ │ │ ├── v-candidate-base.ts │ │ │ ├── v-candidate-record-base.ts │ │ │ ├── v-country-lookup-base.ts │ │ │ ├── v-state-record-base.ts │ │ │ └── v-user-base.ts │ │ └── extended-models │ │ │ ├── application-locale.ts │ │ │ ├── application-module.ts │ │ │ ├── application-object-type.ts │ │ │ ├── application-object.ts │ │ │ ├── application-time-zone.ts │ │ │ ├── application-user-token.ts │ │ │ ├── candidate-availability.ts │ │ │ ├── candidate.ts │ │ │ ├── component-language-content.ts │ │ │ ├── country.ts │ │ │ ├── index.ts │ │ │ ├── language-content-key.ts │ │ │ ├── language-content.ts │ │ │ ├── module-master.ts │ │ │ ├── role-permission.ts │ │ │ ├── role.ts │ │ │ ├── state.ts │ │ │ ├── user-role.ts │ │ │ ├── user.ts │ │ │ ├── v-candidate-record.ts │ │ │ ├── v-candidate.ts │ │ │ ├── v-country-lookup.ts │ │ │ ├── v-state-record.ts │ │ │ └── v-user.ts │ │ └── uris │ │ └── country-lookups.uri.ts │ └── Tours of Contoso Application │ └── Beginner │ └── ContosoApplication │ ├── ContosoApplication.Api │ ├── Bootstrap │ │ ├── AddDbContext.cs │ │ ├── ConfigurationOptions.cs │ │ ├── Performance.cs │ │ ├── Scoped.cs │ │ ├── Security.cs │ │ ├── Singleton.cs │ │ └── Swagger.cs │ ├── ContosoApplication.Api.csproj │ ├── Controllers │ │ └── Api │ │ │ ├── Core │ │ │ ├── AuthenticationController.cs │ │ │ └── AuthorizeController.cs │ │ │ └── MasterModule │ │ │ ├── CoursesController.cs │ │ │ └── StudentsController.cs │ ├── Program.cs │ ├── Startup.cs │ ├── appsettings.json │ └── web.config │ ├── ContosoApplication.BoundedContext │ ├── ContosoApplication.BoundedContext.csproj │ ├── DbContext │ │ └── Main │ │ │ ├── LoginContext.cs │ │ │ └── MasterContext.cs │ ├── Singleton │ │ └── TenantDbConnectionInfo.cs │ └── SqlDbContext │ │ ├── LogSqlDbContext.cs │ │ └── MainSqlDbContext.cs │ ├── ContosoApplication.Domain │ └── ContosoApplication.Domain.csproj │ ├── ContosoApplication.Infrastructure │ ├── ContosoApplication.Infrastructure.csproj │ ├── Security │ │ ├── ApplicationTokenProvider.cs │ │ ├── Authorization │ │ │ └── AccessPermissionHandler.cs │ │ └── TokenAuthorizer.cs │ └── Singleton │ │ └── UserAccessConfigInfo.cs │ ├── ContosoApplication.Models │ ├── ContosoApplication.Models.csproj │ ├── DbEntities │ │ └── Main │ │ │ ├── ApplicationLocale.cs │ │ │ ├── ApplicationModule.cs │ │ │ ├── ApplicationObject.cs │ │ │ ├── ApplicationObjectType.cs │ │ │ ├── ApplicationTimeZone.cs │ │ │ ├── ApplicationUserToken.cs │ │ │ ├── ComponentLanguageContent.cs │ │ │ ├── Course.cs │ │ │ ├── LanguageContent.cs │ │ │ ├── LanguageContentKey.cs │ │ │ ├── ModuleMaster.cs │ │ │ ├── Role.cs │ │ │ ├── RolePermission.cs │ │ │ ├── Student.cs │ │ │ ├── User.cs │ │ │ ├── UserRole.cs │ │ │ ├── vCourseLookup.cs │ │ │ ├── vStudent.cs │ │ │ ├── vStudentRecord.cs │ │ │ └── vUser.cs │ ├── Enums │ │ └── Main │ │ │ └── Status.cs │ ├── ExtendedModels │ │ └── Main │ │ │ └── Course.cs │ ├── Interface │ │ ├── ILogDatabaseFacade.cs │ │ └── IMainDatabaseFacade.cs │ ├── Models │ │ └── SecurityConfig.cs │ └── ViewModels │ │ ├── AuthenticationModel.cs │ │ ├── StoreProcResult.cs │ │ └── UserConfig.cs │ ├── ContosoApplication.UnitOfWork │ ├── BaseUow.cs │ ├── ContosoApplication.UnitOfWork.csproj │ ├── DbEntityAudit │ │ └── AuditLog.cs │ └── Main │ │ ├── LoginUow.cs │ │ └── MasterUow.cs │ ├── ContosoApplication_Beginner.sln │ ├── SQL Scripts │ ├── log.sql │ └── main.sql │ └── rxweb-tool │ ├── config.json │ ├── controllers.main.json │ └── models.main.json └── VsixProject └── AspNetCoreVsix ├── AspNetCoreVsix.csproj ├── AspNetCoreVsix.sln ├── AspNetCoreVsixPackage.cs ├── ProjectTemplates └── CleanArchitecture.zip ├── Properties └── AssemblyInfo.cs ├── icon.png ├── license.txt ├── preview.png └── source.extension.vsixmanifest /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report about something that is not working. 4 | title: '' 5 | labels: bug 6 | assignees: ajayojha 7 | 8 | --- 9 | 10 | ### Describe the bug 11 | A clear and concise description of what the bug is. 12 | 13 | ### To Reproduce 14 | 25 | 26 | ### Further technical details 27 | - ASP.NET Core version 28 | - Include the output of `dotnet --info` 29 | - The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project. 4 | title: '' 5 | labels: feature 6 | assignees: ajayojha 7 | 8 | --- 9 | 10 | ### Is your feature request related to a problem? Please describe. 11 | A clear and concise description of what the problem is. 12 | Example: I am trying to do [...] but [...] 13 | 14 | ### Describe the solution you'd like 15 | A clear and concise description of what you want to happen. Include any alternative solutions you've considered. 16 | 17 | ### Additional context 18 | Add any other context or screenshots about the feature request here. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rx -------------------------------------------------------------------------------- /src/AspNetCore/RxWeb.Core.AspNetCore/Abstract/BaseLookupController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using RxWeb.Core.Data; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Linq.Expressions; 7 | using System.Threading.Tasks; 8 | 9 | namespace RxWeb.Core.AspNetCore 10 | { 11 | public abstract class BaseLookupController : ControllerBase 12 | { 13 | protected ICoreUnitOfWork Uow { get; set; } 14 | public BaseLookupController(ICoreUnitOfWork uow) 15 | { 16 | this.Uow = uow; 17 | } 18 | 19 | protected virtual async Task> AllAsync() where T : class => 20 | await this.Uow.Repository().AllAsync(); 21 | 22 | protected IEnumerable OrderBy(Expression> predicate) where T:class => this.Uow.Repository().Queryable().OrderBy(predicate); 23 | 24 | protected IEnumerable Where(Expression> predicate) where T : class => this.Uow.Repository().FindBy(predicate); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/AspNetCore/RxWeb.Core.AspNetCore/Extensions/ApplicationExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using System.Linq; 3 | 4 | namespace RxWeb.Core.AspNetCore.Extensions 5 | { 6 | public static class ApplicationExtensions 7 | { 8 | public static object GetKeyValue(object entity) { 9 | var primaryKey = entity.GetType().GetProperties().FirstOrDefault(p => p.GetCustomAttributes(typeof(KeyAttribute), false).Count() > 0); 10 | if (primaryKey != null) { 11 | return primaryKey.GetValue(entity); 12 | } 13 | return 0; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/AzureFunction/RxWeb.Core.AzureFunction/RxWeb.Core.AzureFunction.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/Api.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | netcoreapp3.1 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/Bootstrap/AddDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using CleanArchitecture.BoundedContext.SqlContext; 3 | 4 | namespace CleanArchitecture.Api.Bootstrap 5 | { 6 | public static class AddDbContextExtension 7 | { 8 | public static void AddDbContextService(this IServiceCollection serviceCollection) 9 | { 10 | #region SqlDbContext 11 | serviceCollection.AddDbContext(); 12 | serviceCollection.AddScoped(); 13 | serviceCollection.AddDbContext(); 14 | serviceCollection.AddScoped(); 15 | #endregion SqlDbContext 16 | 17 | 18 | 19 | } 20 | } 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/Bootstrap/ConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | using CleanArchitecture.Models; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using RxWeb.Core.Data.Models; 5 | 6 | namespace CleanArchitecture.Api.Bootstrap 7 | { 8 | public static class ConfigurationOptions 9 | { 10 | public static void AddConfigurationOptions(this IServiceCollection serviceCollection, IConfiguration configuration) { 11 | #region ConfigurationOptions 12 | serviceCollection.Configure(configuration.GetSection("Database")); 13 | serviceCollection.Configure(configuration.GetSection("Security")); 14 | #endregion ConfigurationOptions 15 | } 16 | } 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/Bootstrap/Singleton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using CleanArchitecture.Infrastructure.Singleton; 3 | using CleanArchitecture.BoundedContext.Singleton; 4 | using RxWeb.Core.Data; 5 | 6 | namespace CleanArchitecture.Api.Bootstrap 7 | { 8 | public static class Singleton 9 | { 10 | public static void AddSingletonService(this IServiceCollection serviceCollection) { 11 | #region Singleton 12 | serviceCollection.AddSingleton(); 13 | serviceCollection.AddSingleton(typeof(UserAccessConfigInfo)); 14 | #endregion Singleton 15 | } 16 | 17 | } 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace CleanArchitecture.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "Database": { 5 | "MultiTenant": { 6 | "SchemaBased": { 7 | "ConfigFromDb": false, 8 | "HostUriSchemaMappings": {} 9 | }, 10 | "DatabaseBased": { 11 | "ConfigFromDb": false, 12 | "HostUriConnectionMappings": {} 13 | }, 14 | "TenantColumnName": "" 15 | }, 16 | "ConnectionString": { 17 | "Main": "data source=PC0326\\MSSQL2017;initial catalog=CleanArchitectureDb;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework", 18 | "Log": "data source=PC0326\\MSSQL2017;initial catalog=CleanArchitectureLogDb;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework", 19 | }, 20 | "CommandTimeout": 100, 21 | "ConnectionResiliency": { 22 | "MaxRetryCount": 2, 23 | "MaxRetryDelay": 20 24 | } 25 | }, 26 | "Security": { 27 | "AllowedHosts": [ "http://localhost:4200" ], 28 | "AllowedIps": [] 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Api/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/CleanArchitecture/BoundedContext/BoundedContext.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/CleanArchitecture/BoundedContext/SqlDbContext/LogSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using CleanArchitecture.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace CleanArchitecture.BoundedContext.SqlContext 11 | { 12 | public class LogSqlDbContext : BaseDbContext, ILogDatabaseFacade, IDisposable 13 | { 14 | public LogSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Log")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/CleanArchitecture/BoundedContext/SqlDbContext/MainSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using CleanArchitecture.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace CleanArchitecture.BoundedContext.SqlContext 11 | { 12 | public class MainSqlDbContext : BaseDbContext, IMainDatabaseFacade, IDisposable 13 | { 14 | public MainSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Main")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Domain/Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | netcoreapp3.1 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Infrastructure/Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | netcoreapp3.1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/Enums/Main/Status.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArchitecture.Models.Enums.Main 2 | { 3 | public enum Status 4 | { 5 | Active = 1, 6 | InActive = 3, 7 | Deleted = 4, 8 | } 9 | } -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/Interface/ILogDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace CleanArchitecture.BoundedContext.SqlContext 4 | { 5 | public interface ILogDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/Interface/IMainDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace CleanArchitecture.BoundedContext.SqlContext 4 | { 5 | public interface IMainDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/Models/SecurityConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CleanArchitecture.Models 4 | { 5 | public class SecurityConfig 6 | { 7 | public string[] AllowedHosts { get; set; } 8 | 9 | public string[] AllowedIps { get; set; } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/ViewModels/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace CleanArchitecture.Models.ViewModels 4 | { 5 | 6 | public partial class AuthenticationModel 7 | { 8 | [Required] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | public string Password { get; set; } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/ViewModels/StoreProcResult.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArchitecture.Models.ViewModels 2 | { 3 | public class StoreProcResult 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Result { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/CleanArchitecture/Models/ViewModels/UserConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace CleanArchitecture.Models.ViewModels 3 | { 4 | public class UserConfig 5 | { 6 | 7 | public string AudienceType { get; set; } 8 | 9 | public string LanguageCode { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/CleanArchitecture/UnitOfWork/BaseUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | 3 | namespace CleanArchitecture.UnitOfWork 4 | { 5 | public class BaseUow : CoreUnitOfWork 6 | { 7 | public BaseUow(IDbContext context, IRepositoryProvider repositoryProvider,IAuditLog auditLog = null) : base(context, repositoryProvider,auditLog) { } 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/CleanArchitecture/UnitOfWork/Main/LoginUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using CleanArchitecture.BoundedContext.Main; 3 | 4 | namespace CleanArchitecture.UnitOfWork.Main 5 | { 6 | public class LoginUow : BaseUow, ILoginUow 7 | { 8 | public LoginUow(ILoginContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ILoginUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/CleanArchitecture/UnitOfWork/UnitOfWork.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | netcoreapp3.1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/CleanArchitecture/rxweb-tool/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "api": "CleanArchitecture.Api", 4 | "model": "CleanArchitecture.Models", 5 | "context": "CleanArchitecture.BoundedContext", 6 | "domain": "CleanArchitecture.Domain", 7 | "unitOfWork": "CleanArchitecture.UnitOfWork", 8 | "infrastructure": "CleanArchitecture.Infrastructure", 9 | "azureFunctionHttp":"", 10 | "portal":"", 11 | "azureFunctionBackground":"" 12 | }, 13 | "path": { 14 | "dbConnection": { 15 | "main": "Database.ConnectionString.Main" 16 | }, 17 | "folder": { 18 | "model": "DbEntities", 19 | "context": "", 20 | "enums": "", 21 | "localizeValidationMessage": "wwwroot" 22 | } 23 | }, 24 | "annotations": { 25 | "rxweb": false 26 | }, 27 | "config": { 28 | "generateEnums": false, 29 | "commanTableSchema": "dbo", 30 | "validationMessageLocalizationId": "15" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/CleanArchitecture/rxweb-tool/models.log.json: -------------------------------------------------------------------------------- 1 | [{"Name":"AuditRecordDetails","Auditable":false,"PrimaryTextColumnName":null,"Keys":["AuditRecordDetailId"]},{"Name":"AuditRecords","Auditable":false,"PrimaryTextColumnName":null,"Keys":["AuditRecordId"]},{"Name":"AuditRequests","Auditable":false,"PrimaryTextColumnName":null,"Keys":["AuditRequestId"]},{"Name":"ExceptionLogs","Auditable":false,"PrimaryTextColumnName":null,"Keys":["ExceptionLogId"]},{"Name":"RequestTraces","Auditable":false,"PrimaryTextColumnName":null,"Keys":["TraceId"]}] -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Attributes/ModelValidation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Annotations 4 | { 5 | public class ModelValidationAttribute : Attribute 6 | { 7 | public string KeyName { get; set; } 8 | public ModelValidationAttribute(string keyName) { 9 | KeyName = keyName; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Constants/ApplicationConstants.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Annotations.Constants 2 | { 3 | internal class ApplicationConstants 4 | { 5 | public const string AllowWhiteSpace = "AllowWhiteSpace"; 6 | 7 | public const string CustomMessageKey = "CustomMessageKey"; 8 | 9 | public const string ConditionalExpressionName = "ExpressionName"; 10 | 11 | public const string DynamicConfigExpressionName = "DynamicConfigExpressionName"; 12 | 13 | public const string Invalid = "Invalid"; 14 | 15 | public const string AllowMinimum = "AllowMinimum"; 16 | 17 | public const string AllowMaximum = "AllowMaximum"; 18 | 19 | public const string AllowMaximumLength = "AllowMaximumLength"; 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Conventions/ModelValidationFilterConvention.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.ApplicationModels; 2 | using System; 3 | 4 | namespace RxWeb.Core.Annotations.Conventions 5 | { 6 | public class ModelValidationFilterConvention : IApplicationModelConvention 7 | { 8 | private readonly ModelValidationFilterFactory validationFilterFactory = new ModelValidationFilterFactory(); 9 | 10 | public void Apply(ActionModel action) 11 | { 12 | if (action == null) 13 | { 14 | throw new ArgumentNullException(nameof(action)); 15 | } 16 | 17 | if (!ShouldApply(action)) 18 | { 19 | return; 20 | } 21 | 22 | action.Filters.Add(validationFilterFactory); 23 | } 24 | 25 | public void Apply(ApplicationModel application) 26 | { 27 | application.Filters.Add(validationFilterFactory); 28 | } 29 | 30 | protected virtual bool ShouldApply(ActionModel action) => true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Enums/SqlQueryOperator.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Annotations.Enums 2 | { 3 | public enum SqlQueryOperator 4 | { 5 | Equal = 1, 6 | NotEqual, 7 | GreaterThan, 8 | LessThan, 9 | GraterThanEqualTo, 10 | LessThanEqualTo 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Extensions/ApplicationExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Annotations.Extensions 2 | { 3 | internal static class ApplicationExtensions 4 | { 5 | public static string ToCamelCase(this string value) 6 | { 7 | return value.Remove(1, value.Length - 1).ToLower() + value.Remove(0, 1); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Extensions/MvcOptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using RxWeb.Core.Annotations.Conventions; 3 | 4 | namespace RxWeb.Core.AspNetCore.Extensions 5 | { 6 | public static class MvcOptionExtensions 7 | { 8 | public static void AddValidation(this MvcOptions options) 9 | { 10 | options.Conventions.Add(new ModelValidationFilterConvention()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Factory/ModelValidationFilterFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Filters; 2 | using RxWeb.Core.Annotations.Filters; 3 | using System; 4 | 5 | namespace RxWeb.Core.Annotations 6 | { 7 | class ModelValidationFilterFactory : IFilterFactory, IOrderedFilter 8 | { 9 | public int Order => ModelValidationFilter.ValidationFilterOrder; 10 | 11 | public bool IsReusable => true; 12 | 13 | public IFilterMetadata CreateInstance(IServiceProvider serviceProvider) 14 | { 15 | return new ModelValidationFilter(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Interface/IDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Infrastructure; 2 | 3 | namespace RxWeb.Core.Annotations 4 | { 5 | public interface IDatabaseFacade 6 | { 7 | DatabaseFacade Database { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Interface/ILocalizationInfo.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core 2 | { 3 | public interface ILocalizationInfo 4 | { 5 | string CurrentLocale { get; } 6 | 7 | string GetValidationMessage(string keyName); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Interface/IModelValidation.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using RxWeb.Core.Annotations.Models; 3 | 4 | namespace RxWeb.Core.Annotations 5 | { 6 | public interface IModelValidation 7 | { 8 | ValidationResultModel Validate(object value, HttpContext httpContext); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Interface/IValidator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using System.Reflection; 3 | 4 | namespace RxWeb.Core.Annotations 5 | { 6 | public interface IValidator 7 | { 8 | string Validate(object value, HttpContext context,PropertyInfo property,ILocalizationInfo localizationInfo); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Models/UniqueQuery.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations.Enums; 2 | 3 | namespace RxWeb.Core.Annotations.Models 4 | { 5 | public class UniqueQuery 6 | { 7 | public string ColumnName { get; set; } 8 | 9 | public SqlQueryOperator QueryOperator { get; set; } 10 | 11 | public object Value { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Models/ValidationMessageConfig.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Annotations 2 | { 3 | public class ValidationMessageConfig 4 | { 5 | public string MessageKey { get; set; } 6 | 7 | public string ExpressionName { get; set; } 8 | 9 | public string DynamicConfigExpressionName { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Annotations/Models/ValidationResultModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace RxWeb.Core.Annotations.Models 4 | { 5 | public class ValidationResultModel 6 | { 7 | public string Type { get; set; } 8 | 9 | public string Title { get; set; } 10 | 11 | public int Status { get; set; } 12 | 13 | public Dictionary Errors { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Cache/Filters/Cacheable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc.Filters; 3 | using Microsoft.Net.Http.Headers; 4 | using System; 5 | 6 | namespace RxWeb.Core.Cache 7 | { 8 | public class Cachable : ActionFilterAttribute 9 | { 10 | private double Milliseconds { get; set; } 11 | public Cachable(double milliseconds) { 12 | Milliseconds = milliseconds; 13 | } 14 | public override void OnActionExecuted(ActionExecutedContext context) 15 | { 16 | if (context.HttpContext.Response.StatusCode == 200 && context.HttpContext.Request.Method == "GET") 17 | SetResponseCacheControl(context.HttpContext.Response); 18 | } 19 | 20 | private void SetResponseCacheControl(HttpResponse response) 21 | { 22 | response.GetTypedHeaders().CacheControl = new CacheControlHeaderValue() 23 | { 24 | MaxAge = TimeSpan.FromMilliseconds(Milliseconds), 25 | Private = true 26 | }; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Cache/Filters/NoCacheable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc.Filters; 3 | using Microsoft.Net.Http.Headers; 4 | 5 | namespace RxWeb.Core.Cache 6 | { 7 | public class NoCacheable : ActionFilterAttribute 8 | { 9 | public NoCacheable() { } 10 | 11 | 12 | public override void OnActionExecuted(ActionExecutedContext context) 13 | { 14 | if (context.HttpContext.Response.StatusCode == 200) 15 | context.HttpContext.Response.GetTypedHeaders().CacheControl = new CacheControlHeaderValue 16 | { 17 | NoCache = true, 18 | MustRevalidate = true, 19 | Private = true 20 | }; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Cache/Models/TagCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Cache 4 | { 5 | internal class TagCache 6 | { 7 | public Type Controller { get; set; } 8 | 9 | public string Etag { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Cache/RxWeb.Core.Cache.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 2.0.2 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Enums/EmailFormatType.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Common 2 | { 3 | public enum EmailFormatType 4 | { 5 | Html 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Interface/IEmail.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace RxWeb.Core.Common 4 | { 5 | public interface IEmail 6 | { 7 | Task SendAsync(MailConfig config); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Interface/ITextSms.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace RxWeb.Core.Common 4 | { 5 | public interface ITextSms 6 | { 7 | Task SendAsync(SmsConfig smsConfig); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Models/MailConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | 4 | namespace RxWeb.Core.Common 5 | { 6 | public class MailConfig 7 | { 8 | public EmailFormatType EmailFormat { get; set; } = EmailFormatType.Html; 9 | 10 | public string From { get; set; } 11 | 12 | public List To { get; set; } = new List(); 13 | 14 | public string Body { get; set; } 15 | 16 | public string Subject { get; set; } 17 | 18 | public Dictionary Attachments { get; set; } = new Dictionary(); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Models/MailKitEmailConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Common.Models 2 | { 3 | public class MailKitEmailConfiguration 4 | { 5 | public string Host { get; set; } 6 | 7 | public int Port { get; set; } 8 | 9 | public string UserName { get; set; } 10 | 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Models/SendGridEmailConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Common.Models 2 | { 3 | public class SendGridEmailConfiguration 4 | { 5 | public string ApiKey { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Models/SmsConfig.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Common 2 | { 3 | public class SmsConfig 4 | { 5 | public string From { get; set; } 6 | 7 | public string To { get; set; } 8 | 9 | public string Body { get; set; } 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Models/StandardEmailConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Common.Models 2 | { 3 | public class StandardEmailConfiguration 4 | { 5 | public int Port { get; set; } 6 | 7 | public bool UseDefaultCredentials { get; set; } 8 | 9 | public bool EnableSsl { get; set; } 10 | 11 | public string Host { get; set; } 12 | 13 | public string PickupDirectoryLocation { get; set; } 14 | 15 | public string UserName { get; set; } 16 | 17 | public string Password { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Models/TwilioSmsConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Common.Models 2 | { 3 | public class TwilioSmsConfiguration 4 | { 5 | public string AccountSid { get; set; } 6 | 7 | public string AuthToken { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/RxWeb.Core.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Common/Sms/TwilioSms.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Common.Models; 2 | using System.Threading.Tasks; 3 | using Twilio; 4 | using Twilio.Rest.Api.V2010.Account; 5 | 6 | namespace RxWeb.Core.Common.Sms 7 | { 8 | public class TwilioSms : ITextSms 9 | { 10 | public TwilioSms(TwilioSmsConfiguration smsConfiguration) { 11 | SmsConfiguration = smsConfiguration; 12 | } 13 | public Task SendAsync(SmsConfig smsConfig) 14 | { 15 | TwilioClient.Init(SmsConfiguration.AccountSid, SmsConfiguration.AuthToken); 16 | var message = MessageResource.Create( 17 | body: smsConfig.Body, 18 | from: new Twilio.Types.PhoneNumber(smsConfig.From), 19 | to: new Twilio.Types.PhoneNumber(smsConfig.To) 20 | ); 21 | return Task.CompletedTask; 22 | } 23 | 24 | public TwilioSmsConfiguration SmsConfiguration { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Localization/Extensions/LocalizationExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using RxWeb.Core.Localization; 3 | using RxWeb.Core.Localization.Singleton; 4 | using System.Collections.Generic; 5 | 6 | namespace RxWeb.Core.AspNetCore.Extensions 7 | { 8 | public static class LocalizationExtensions 9 | { 10 | public static void AddRxWebLocalization(this IServiceCollection serviceCollection, Dictionary> localizeKeys = null) 11 | { 12 | if (localizeKeys != null) { 13 | ApplicationLocalizationInfo.IsStaticMessages = true; 14 | ApplicationLocalizationInfo.LocalizeKeys = localizeKeys; 15 | } 16 | serviceCollection.AddScoped(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Localization/RxWeb.Core.Localization.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 3.0.1 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Logging/Extensions/LoggingExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using RxWeb.Core.Logging; 3 | using System; 4 | 5 | namespace RxWeb.Core.AspNetCore.Extensions 6 | { 7 | public static class LoggingExtensions 8 | { 9 | public static IApplicationBuilder UseLogging(this IApplicationBuilder builder, Type databaseFacade) 10 | { 11 | return builder.UseMiddleware(databaseFacade); 12 | } 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Logging/Extensions/MvcOptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using RxWeb.Core.Logging.Filters; 3 | 4 | namespace RxWeb.Core.AspNetCore.Extensions 5 | { 6 | public static class MvcOptionExtensions 7 | { 8 | public static void AddTracing(this MvcOptions options) 9 | { 10 | options.Filters.Add(new RequestTracing()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Logging/Models/TraceRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Logging 4 | { 5 | public class TraceRequest : Attribute 6 | { 7 | public string GetTitle { get; set; } 8 | 9 | public string GetByTitle { get; set; } 10 | 11 | public string PostTitle { get; set; } 12 | 13 | public string PutTitle { get; set; } 14 | 15 | public string PatchTitle { get; set; } 16 | 17 | public string DeleteTitle { get; set; } 18 | 19 | public string GetCategory { get; set; } 20 | 21 | public string GetByCategory { get; set; } 22 | 23 | public string PostCategory { get; set; } 24 | 25 | public string PutCategory { get; set; } 26 | 27 | public string PatchCategory { get; set; } 28 | 29 | public string DeleteCategory { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Logging/RxWeb.Core.Logging.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 3.0.1 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/CompositeKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class CompositeKeyAttribute : Attribute 6 | { 7 | 8 | public CompositeKeyAttribute() 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/DefaultSchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class DefaultSchema : Attribute 6 | { 7 | public DefaultSchema(string name) { 8 | SchemaName = name; 9 | } 10 | 11 | public string SchemaName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/HasOneAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace RxWeb.Core.Data.Annotations 5 | { 6 | public class HasOneAttribute : Attribute 7 | { 8 | 9 | public HasOneAttribute(string[] foreignKeys, string withMany = "", string[] principalKeys = null) 10 | { 11 | this.ForeignKeys = foreignKeys; 12 | this.WithMany = withMany; 13 | this.PrincipalKeys = principalKeys; 14 | } 15 | 16 | public string[] PrincipalKeys { get; set; } 17 | public string[] ForeignKeys { get; set; } 18 | public string WithMany { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/KeyLessEntityAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class KeyLessEntityAttribute : Attribute 6 | { 7 | 8 | public KeyLessEntityAttribute() 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/LogPropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class LogPropertyAttribute : Attribute 6 | { 7 | public LogPropertyAttribute() 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/NotNullableAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | [AttributeUsage(AttributeTargets.Parameter)] 6 | internal sealed class NotNullAttribute : Attribute 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/PrimaryTextColumnAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class PrimaryTextColumnAttribute : Attribute 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/RecordLogAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class RecordLogAttribute : Attribute 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/RelationShipTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class RelationshipTableAttribue : Attribute 6 | { 7 | public RelationshipTableAttribue(string name, string schema, string primaryTextColumnName ="", string primaryKeyName = "",string secondaryKeyName = "") 8 | { 9 | Name = name; 10 | Schema = schema; 11 | PrimaryKeyName = primaryKeyName; 12 | SecondaryKeyName = secondaryKeyName; 13 | PrimaryTextColumnName = primaryTextColumnName; 14 | } 15 | 16 | public string Name { get; private set; } 17 | public string Schema { get; set; } 18 | 19 | public string PrimaryKeyName { get; set; } 20 | 21 | public string SecondaryKeyName { get; set; } 22 | 23 | public string PrimaryTextColumnName { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/SharedKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class SharedKeyAttribute : Attribute 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/TableKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class TableKeyAttribute : Attribute 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/TenantQueryFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class TenantQueryFilterAttribute : Attribute 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/TimeZoneConversionAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 2 | using RxWeb.Core.Data.Interface; 3 | using RxWeb.Core.Data.Singleton; 4 | using System; 5 | 6 | namespace RxWeb.Core.Data.Annotations 7 | { 8 | public class TimeZoneValueConversionAttribute : Attribute, ITimeZoneConverter 9 | { 10 | public TimeZoneValueConversionAttribute() 11 | { 12 | 13 | } 14 | 15 | public ValueConverter GetConverter(string timeZoneName) 16 | { 17 | var converter = new ValueConverter( 18 | v => (DateTimeOffset)v, 19 | v => TimeZoneValueProvider.TransformValue(v, timeZoneName) 20 | ); 21 | return converter; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Annotations/ValueConversionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data.Annotations 4 | { 5 | public class ValueConversionAttribute : Attribute 6 | { 7 | 8 | public Type ConversionType { get; set; } 9 | public ValueConversionAttribute(Type type) 10 | { 11 | ConversionType = type; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Const/CustomClaimTypes.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace RxWeb.Core.Security 3 | { 4 | public class CustomClaimTypes 5 | { 6 | public const string TenantId = "tid"; 7 | 8 | public const string TimeZone = "tzone"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Core/InstanceRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data 4 | { 5 | internal class InstanceRepository 6 | { 7 | public Type Entity { get; set; } 8 | 9 | public object Repository { get; set; } 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Extensions/KeyLessEntityExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using RxWeb.Core.Data.Annotations; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | namespace RxWeb.Core.Data 9 | { 10 | public static class KeyLessEntityExtension 11 | { 12 | public static ModelBuilder AddHasNoKeys(this ModelBuilder modelBuilder) 13 | { 14 | var entityTypes = modelBuilder.Model.GetEntityTypes().Select(t => t.ClrType).ToList(); 15 | var entities = entityTypes.Where(t => t.GetCustomAttributes(typeof(KeyLessEntityAttribute), true).Count() > 0); 16 | var enumerator = entities.GetEnumerator(); 17 | while (enumerator.MoveNext()) 18 | modelBuilder.Entity(enumerator.Current).HasNoKey(); 19 | return modelBuilder; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/IAuditLog.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace RxWeb.Core.Data 6 | { 7 | public interface IAuditLog 8 | { 9 | void Log(List auditRecord); 10 | 11 | void OnException(Exception ex); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/IConcurrencyException.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.ChangeTracking; 2 | 3 | namespace RxWeb.Core.Data.Interface 4 | { 5 | public interface IConcurrencyException 6 | { 7 | void OnConcurrencyException(EntityEntry entity,ICoreUnitOfWork uow); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/IDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.ChangeTracking; 3 | using Microsoft.EntityFrameworkCore.Infrastructure; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace RxWeb.Core.Data 8 | { 9 | public interface IDbContext 10 | { 11 | //string Name { get; } 12 | DatabaseFacade Database { get; } 13 | 14 | DbSet Set() where TEntity : class; 15 | 16 | EntityEntry Entry(T entity) where T : class; 17 | int SaveChanges(); 18 | 19 | Task SaveChangesAsync(CancellationToken cancellationToken = default); 20 | 21 | ChangeTracker ChangeTracker { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/IDbContextManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Data.SqlClient; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Storage; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace RxWeb.Core.Data 8 | { 9 | public interface IDbContextManager where DbContextEntity : DbContext 10 | { 11 | Task BeginTransactionAsync(); 12 | 13 | Task BeginTransactionAsync(params ICoreUnitOfWork[] coreUnitOfWorks); 14 | 15 | void RollbackTransaction(); 16 | 17 | Task CommitAsync(); 18 | 19 | Task CommitAsync(params ICoreUnitOfWork[] coreUnitOfWorks); 20 | 21 | Task> StoreProc(string name, SqlParameter[] sqlParameters) where TEntity : new(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/IRepositoryProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Data 4 | { 5 | public interface IRepositoryProvider : IDisposable 6 | { 7 | IRepository Repository(IDbContext context, Type instance) where TEntity : class; 8 | 9 | dynamic GetRepositoryByType(Type entityType, Type instanceType); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/ISqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore.Infrastructure; 3 | using System.Data.Common; 4 | 5 | namespace RxWeb.Core.Data 6 | { 7 | public interface ISqlDbContext 8 | { 9 | DatabaseFacade Database { get; } 10 | 11 | DbConnection DbConnection { get;} 12 | 13 | DbSet Set() where TEntity : class; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/ITenantDbConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading.Tasks; 5 | 6 | namespace RxWeb.Core.Data 7 | { 8 | public interface ITenantDbConnectionInfo 9 | { 10 | Task> GetAsync(string hostUri); 11 | 12 | void Save(string hostUri, Dictionary value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/ITimeZoneConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 2 | 3 | namespace RxWeb.Core.Data.Interface 4 | { 5 | public interface ITimeZoneConverter 6 | { 7 | ValueConverter GetConverter(string timeZoneName); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Interface/IValueConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 2 | 3 | namespace RxWeb.Core.Data.Interface 4 | { 5 | public interface IValueConverter 6 | { 7 | ValueConverter GetConverter(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/CoreAuditRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace RxWeb.Core.Data.Models 5 | { 6 | public class CoreAuditRecord 7 | { 8 | public int KeyId { get; set; } 9 | 10 | public Nullable CompositeKeyId { get; set; } 11 | 12 | public string EventType { get; set; } 13 | 14 | public string TableName { get; set; } 15 | 16 | public IList AuditRecordDetails { get; set; } 17 | 18 | public CoreAuditRecord() 19 | { 20 | this.AuditRecordDetails = new List(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/CoreAuditRecordDetail.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Data.Models 2 | { 3 | public class CoreAuditRecordDetail 4 | { 5 | public string ColumnName { get; set; } 6 | 7 | 8 | public string OldValue { get; set; } 9 | 10 | 11 | public string NewValue { get; set; } 12 | 13 | public CoreAuditRecordDetail() 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/CoreAuditRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace RxWeb.Core.Data.Models 5 | { 6 | public class CoreAuditRequest 7 | { 8 | public string TraceIdentifier { get; set; } 9 | 10 | public int KeyId { get; set; } 11 | 12 | 13 | public Nullable CompositeKeyId { get; set; } 14 | 15 | public virtual List AuditRecords { get; set; } 16 | 17 | 18 | public CoreAuditRequest() 19 | { 20 | AuditRecords = new List(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/DatabaseBased.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace RxWeb.Core.Data.Models 4 | { 5 | public class DatabaseBased 6 | { 7 | public Dictionary> HostUriConnectionMappings { get; set; } = new Dictionary>(); 8 | public bool ConfigFromDb { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/DatabaseConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace RxWeb.Core.Data.Models 4 | { 5 | public class DatabaseConfig 6 | { 7 | public MultiTenantConfig MultiTenant { get; set; } = new MultiTenantConfig(); 8 | 9 | public Dictionary ConnectionString { get; set; } 10 | 11 | public Dictionary ConnectionResiliency { get; set; } 12 | 13 | public int CommandTimeout { get; set; } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/MultiTenantConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace RxWeb.Core.Data.Models 4 | { 5 | public class MultiTenantConfig 6 | { 7 | public DatabaseBased Database { get; set; } = new DatabaseBased(); 8 | public SchemaBased Schema { get; set; } = new SchemaBased(); 9 | public string TenantColumnName { get; set; } 10 | } 11 | 12 | 13 | 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Models/SchemaBased.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace RxWeb.Core.Data.Models 4 | { 5 | public class SchemaBased 6 | { 7 | public bool ConfigFromDb { get; set; } 8 | public Dictionary> HostUriSchemaMappings { get; set; } = new Dictionary>(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/RxWeb.Core.Data.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 3.0.3-preview2 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Repository/Singleton/TimeZoneValueProvider.cs: -------------------------------------------------------------------------------- 1 | using NodaTime; 2 | using System; 3 | 4 | namespace RxWeb.Core.Data.Singleton 5 | { 6 | public static class TimeZoneValueProvider 7 | { 8 | public static DateTimeOffset TransformValue(DateTimeOffset value,string timeZoneName) { 9 | if (value > DateTimeOffset.MinValue) { 10 | var zoneProvider = DateTimeZoneProviders.Tzdb[timeZoneName]; 11 | var zoneDateTime = Instant.FromDateTimeUtc(value.UtcDateTime) 12 | .InZone(zoneProvider) 13 | .ToDateTimeUnspecified(); 14 | return zoneDateTime; 15 | } 16 | return value; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Enums/ActionValueType.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Sanitizers.Enums 2 | { 3 | public enum ActionValueType 4 | { 5 | DateTime = 1, 6 | DateTimeUtc = 2, 7 | DateTimeOffsetUtc = 3, 8 | NameClaimIdentifier = 4 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Enums/RequestActionType.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Sanitizers.Enums 2 | { 3 | public class RequestActionType 4 | { 5 | public const string Post = "POST"; 6 | 7 | public const string PUT = "PUT"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Extensions/MvcOptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using RxWeb.Core.Sanitizers.Formatters; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace RxWeb.Core.AspNetCore.Extensions 8 | { 9 | public static class MvcOptionExtensions 10 | { 11 | public static void AddRxWebSanitizers(this MvcOptions options) 12 | { 13 | options.InputFormatters.Insert(0, new InputJsonFormatter()); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Interface/BaseSanitizeConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Sanitizers.Interface 4 | { 5 | public interface BaseSanitizeConfig 6 | { 7 | Func ConditionalExpression { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Interface/IActionSanitizer.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using System; 3 | 4 | namespace RxWeb.Core.Sanitizers.Interface 5 | { 6 | public interface IActionSanitizer 7 | { 8 | Object Sanitize(object value, HttpContext context); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Interface/ISanitize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Sanitizers.Interface 4 | { 5 | internal interface ISanitize 6 | { 7 | Object Sanitize(Object value, Object entity,object rootEntity); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Interface/ISanitizer.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Sanitizers.Interface 2 | { 3 | public interface ISanitizer 4 | { 5 | void Sanitize(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Interface/SanitizeConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Sanitizers.Interface 4 | { 5 | public interface SanitizeConfig : BaseSanitizeConfig 6 | { 7 | Func Sanitizer { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/RxWeb.Core.Sanitizers.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 2.0.3 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Sanitizers/EntitySanitizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RxWeb.Core.Sanitizers 4 | { 5 | public class EntitySanitizer : Attribute 6 | { 7 | public Type Injector { get; set; } 8 | public EntitySanitizer(Type type) { 9 | Injector = type; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Sanitizers/EscapeText.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Sanitizers.Interface; 2 | using System; 3 | using System.Text.Encodings.Web; 4 | using System.Text.Unicode; 5 | 6 | namespace RxWeb.Core.Sanitizers 7 | { 8 | public class EscapeText : Attribute, ISanitize 9 | { 10 | public object Sanitize(object value, object entity, object rootEntity) 11 | { 12 | if (!string.IsNullOrEmpty(value as string)) 13 | { 14 | var htmlEncoder = HtmlEncoder.Create(allowedRanges: new[] { UnicodeRanges.BasicLatin, 15 | UnicodeRanges.CjkUnifiedIdeographs }); 16 | return htmlEncoder.Encode(value as string); 17 | } 18 | return value; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Sanitizers/FromBase64String.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Sanitizers.Interface; 2 | using System; 3 | 4 | namespace RxWeb.Core.Sanitizers 5 | { 6 | public class FromBase64String : Attribute, ISanitize 7 | { 8 | public object Sanitize(object value, object entity, object rootEntity) 9 | { 10 | if (!string.IsNullOrEmpty(value as string)) 11 | { 12 | var byteData = System.Convert.FromBase64String(value as string); 13 | return System.Text.ASCIIEncoding.ASCII.GetString(byteData); 14 | } 15 | return value; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Sanitizers/Sanitizers/ToLower.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Sanitizers.Interface; 2 | using System; 3 | 4 | namespace RxWeb.Core.Sanitizers 5 | { 6 | public class ToLower : Attribute, ISanitize 7 | { 8 | public object Sanitize(object value, object entity,object rootEntity) 9 | { 10 | return !String.IsNullOrEmpty(value as string) ? (value as string).ToLower() : value; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Authorization/AccessAtributeInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace RxWeb.Core.Security.Authorization 6 | { 7 | public class AccessAtributeInfo 8 | { 9 | public string ActionType { get; set; } 10 | 11 | public Type HaveAccess { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Authorization/AccessPermissionRequirement.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using System; 3 | 4 | namespace RxWeb.Core.Security.Authorization 5 | { 6 | public class AccessPermissionRequirement : IAuthorizationRequirement 7 | { 8 | public int ApplicationModuleId { get; private set; } 9 | 10 | public string ActionType { get; set; } 11 | 12 | public Type HaveAccess { get; set; } 13 | 14 | public AccessPermissionRequirement(int applicationModuleId,string actionType = null,Type haveAccess = null) { 15 | ApplicationModuleId = applicationModuleId; 16 | ActionType = actionType; 17 | HaveAccess = haveAccess; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Cryptography/PasswordHashResult.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Security.Cryptography 2 | { 3 | public class PasswordResult 4 | { 5 | public byte[] Signature { get; set; } 6 | 7 | public byte[] Salt { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Filters/AllowAnonymousUser.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.Filters; 4 | 5 | namespace RxWeb.Core.Security.Filters 6 | { 7 | public class AllowAnonymousUser : ActionFilterAttribute, IAllowAnonymous 8 | { 9 | public override void OnActionExecuting(ActionExecutingContext context) 10 | { 11 | var tokenAuthorizer = context.HttpContext.RequestServices.GetService(typeof(ITokenAuthorizer)) as ITokenAuthorizer; 12 | var result = tokenAuthorizer.AnonymousUserValidateToken(context.HttpContext); 13 | if (result == null) 14 | context.Result = new StatusCodeResult(401); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Interface/IAccessPermissionHandler.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using RxWeb.Core.Security.Authorization; 3 | using System.Threading.Tasks; 4 | 5 | namespace RxWeb.Core.Security 6 | { 7 | public interface IAccessPermissionHandler 8 | { 9 | Task HandleRequirementAsync(AuthorizationHandlerContext context, AccessPermissionRequirement requirement); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Interface/IJwtTokenProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Security.Claims; 4 | 5 | namespace RxWeb.Core.Security 6 | { 7 | public interface IJwtTokenProvider 8 | { 9 | ClaimsPrincipal ValidateToken(string securityKey, string jsonWebToken); 10 | 11 | KeyValuePair WriteToken(IEnumerable claims, string issuer, string audience, DateTime expires); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Interface/ITokenAuthorizer.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authentication.JwtBearer; 2 | using Microsoft.AspNetCore.Http; 3 | using System.Security.Claims; 4 | using System.Threading.Tasks; 5 | 6 | namespace RxWeb.Core.Security 7 | { 8 | public interface ITokenAuthorizer 9 | { 10 | Task AuthenticationFailed(AuthenticationFailedContext context); 11 | Task Challenge(JwtBearerChallengeContext context); 12 | Task MessageReceived(MessageReceivedContext context); 13 | Task TokenValidated(TokenValidatedContext context); 14 | Task ValidateTokenAsync(HttpContext context); 15 | 16 | ClaimsPrincipal AnonymousUserValidateToken(HttpContext context); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Interface/IUserClaim.cs: -------------------------------------------------------------------------------- 1 | namespace RxWeb.Core.Security 2 | { 3 | public interface IUserClaim 4 | { 5 | string Email { get; } 6 | bool Anonymous { get; } 7 | 8 | string Locale { get; } 9 | 10 | int CountryId { get; } 11 | 12 | string Uri { get; } 13 | 14 | int UserId { get; } 15 | 16 | string UserName { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/RxWeb.Core.Security.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 3.0.2-preview1 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core.Security/Singleton/PolicyProviderAdditionalValue.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Security.Authorization; 2 | using System; 3 | using System.Collections.Concurrent; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace RxWeb.Core.Security.Singleton 8 | { 9 | internal static class PolicyProviderAdditionalValue 10 | { 11 | public static ConcurrentDictionary Values { get; set; } = new ConcurrentDictionary(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core/Interface/ICoreCollectionDomain.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace RxWeb.Core 5 | { 6 | public interface ICoreCollectionDomain 7 | { 8 | HashSet AddValidation(List entity); 9 | HashSet UpdateValidation(List entity); 10 | Task AddAsync(List entity); 11 | Task UpdateAsync(List entity); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core/Interface/ICoreDomain.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace RxWeb.Core 5 | { 6 | public interface ICoreDomain 7 | { 8 | Task GetAsync(FromQuery parameters); 9 | Task GetBy(FromQuery parameters); 10 | 11 | HashSet AddValidation(T entity); 12 | HashSet UpdateValidation(T entity); 13 | 14 | Task AddAsync(T entity); 15 | Task UpdateAsync(T entity); 16 | HashSet DeleteValidation(FromQuery parameters); 17 | Task DeleteAsync(FromQuery parameters); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core/Interface/ICorePatchDomain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace RxWeb.Core 6 | { 7 | public interface ICorePatchDomain : ICoreDomain 8 | { 9 | T PatchEntity(int id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Common/RxWeb.Core/RxWeb.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 2.0.3-preview2 6 | Ajay Ojha 7 | RxWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/Bootstrap/AddDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using $ext_safeprojectname$.BoundedContext.SqlContext; 3 | 4 | namespace $ext_safeprojectname$.Api.Bootstrap 5 | { 6 | public static class AddDbContextExtension 7 | { 8 | public static void AddDbContextService(this IServiceCollection serviceCollection) 9 | { 10 | #region SqlDbContext 11 | serviceCollection.AddDbContext(); 12 | serviceCollection.AddScoped(); 13 | serviceCollection.AddDbContext(); 14 | serviceCollection.AddScoped(); 15 | #endregion SqlDbContext 16 | 17 | 18 | 19 | } 20 | } 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/Bootstrap/ConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | using $ext_safeprojectname$.Models; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using RxWeb.Core.Data.Models; 5 | 6 | namespace $ext_safeprojectname$.Api.Bootstrap 7 | { 8 | public static class ConfigurationOptions 9 | { 10 | public static void AddConfigurationOptions(this IServiceCollection serviceCollection, IConfiguration configuration) { 11 | #region ConfigurationOptions 12 | serviceCollection.Configure(configuration.GetSection("Database")); 13 | serviceCollection.Configure(configuration.GetSection("Security")); 14 | #endregion ConfigurationOptions 15 | } 16 | } 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/Bootstrap/Singleton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using $ext_safeprojectname$.Infrastructure.Singleton; 3 | using $ext_safeprojectname$.BoundedContext.Singleton; 4 | using RxWeb.Core.Data; 5 | 6 | namespace $ext_safeprojectname$.Api.Bootstrap 7 | { 8 | public static class Singleton 9 | { 10 | public static void AddSingletonService(this IServiceCollection serviceCollection) { 11 | #region Singleton 12 | serviceCollection.AddSingleton(); 13 | serviceCollection.AddSingleton(typeof(UserAccessConfigInfo)); 14 | #endregion Singleton 15 | } 16 | 17 | } 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace $ext_safeprojectname$.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/appsettings.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "Database": { 5 | "MultiTenant": { 6 | "SchemaBased": { 7 | "ConfigFromDb": false, 8 | "HostUriSchemaMappings": {} 9 | }, 10 | "DatabaseBased": { 11 | "ConfigFromDb": false, 12 | "HostUriConnectionMappings": {} 13 | }, 14 | "TenantColumnName": "" 15 | }, 16 | "ConnectionString": { 17 | "Main": "", 18 | "Log": "" 19 | }, 20 | "CommandTimeout": 100, 21 | "ConnectionResiliency": { 22 | "MaxRetryCount": 2, 23 | "MaxRetryDelay": 20 24 | } 25 | }, 26 | "Security": { 27 | "AllowedHosts": [ "http://localhost:4200" ], 28 | "AllowedIps": [] 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Api/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/BoundedContext/BoundedContext.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/BoundedContext/SqlDbContext/LogSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using $ext_safeprojectname$.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace $ext_safeprojectname$.BoundedContext.SqlContext 11 | { 12 | public class LogSqlDbContext : BaseDbContext, ILogDatabaseFacade, IDisposable 13 | { 14 | public LogSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Log")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/BoundedContext/SqlDbContext/MainSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using $ext_safeprojectname$.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace $ext_safeprojectname$.BoundedContext.SqlContext 11 | { 12 | public class MainSqlDbContext : BaseDbContext, IMainDatabaseFacade, IDisposable 13 | { 14 | public MainSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Main")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Domain/Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | netcoreapp3.1 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Domain/Domain.vstemplate: -------------------------------------------------------------------------------- 1 | 2 | 3 | Domain 4 | <No description available> 5 | CSharp 6 | 7 | 8 | 1000 9 | true 10 | Domain 11 | true 12 | Enabled 13 | true 14 | true 15 | __TemplateIcon.ico 16 | true 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Infrastructure/Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | netcoreapp3.1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/Enums/Main/Status.cs: -------------------------------------------------------------------------------- 1 | namespace $ext_safeprojectname$.Models.Enums.Main 2 | { 3 | public enum Status 4 | { 5 | Active = 1, 6 | InActive = 3, 7 | Deleted = 4, 8 | } 9 | } -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/Interface/ILogDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace $ext_safeprojectname$.BoundedContext.SqlContext 4 | { 5 | public interface ILogDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/Interface/IMainDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace $ext_safeprojectname$.BoundedContext.SqlContext 4 | { 5 | public interface IMainDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/Models/SecurityConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace $ext_safeprojectname$.Models 4 | { 5 | public class SecurityConfig 6 | { 7 | public string[] AllowedHosts { get; set; } 8 | 9 | public string[] AllowedIps { get; set; } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/ViewModels/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace $ext_safeprojectname$.Models.ViewModels 4 | { 5 | 6 | public partial class AuthenticationModel 7 | { 8 | [Required] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | public string Password { get; set; } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/ViewModels/StoreProcResult.cs: -------------------------------------------------------------------------------- 1 | namespace $ext_safeprojectname$.Models.ViewModels 2 | { 3 | public class StoreProcResult 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Result { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/Models/ViewModels/UserConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace $ext_safeprojectname$.Models.ViewModels 3 | { 4 | public class UserConfig 5 | { 6 | 7 | public string AudienceType { get; set; } 8 | 9 | public string LanguageCode { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/UnitOfWork/BaseUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | 3 | namespace $ext_safeprojectname$.UnitOfWork 4 | { 5 | public class BaseUow : CoreUnitOfWork 6 | { 7 | public BaseUow(IDbContext context, IRepositoryProvider repositoryProvider,IAuditLog auditLog = null) : base(context, repositoryProvider,auditLog) { } 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/UnitOfWork/Main/LoginUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using $ext_safeprojectname$.BoundedContext.Main; 3 | 4 | namespace $ext_safeprojectname$.UnitOfWork.Main 5 | { 6 | public class LoginUow : BaseUow, ILoginUow 7 | { 8 | public LoginUow(ILoginContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ILoginUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/UnitOfWork/UnitOfWork.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | netcoreapp3.1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/ProjectTemplates/AspNetCore/Project Template/CleanArchitecture/icon.png -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/.template.config/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/.template.config/icon.png -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/Bootstrap/AddDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using CleanArchitecture.BoundedContext.SqlContext; 3 | 4 | namespace CleanArchitecture.Api.Bootstrap 5 | { 6 | public static class AddDbContextExtension 7 | { 8 | public static void AddDbContextService(this IServiceCollection serviceCollection) 9 | { 10 | #region SqlDbContext 11 | serviceCollection.AddDbContext(); 12 | serviceCollection.AddScoped(); 13 | serviceCollection.AddDbContext(); 14 | serviceCollection.AddScoped(); 15 | #endregion SqlDbContext 16 | 17 | 18 | 19 | } 20 | } 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/Bootstrap/ConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | using CleanArchitecture.Models; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using RxWeb.Core.Data.Models; 5 | 6 | namespace CleanArchitecture.Api.Bootstrap 7 | { 8 | public static class ConfigurationOptions 9 | { 10 | public static void AddConfigurationOptions(this IServiceCollection serviceCollection, IConfiguration configuration) { 11 | #region ConfigurationOptions 12 | serviceCollection.Configure(configuration.GetSection("Database")); 13 | serviceCollection.Configure(configuration.GetSection("Security")); 14 | #endregion ConfigurationOptions 15 | } 16 | } 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/Bootstrap/Singleton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using CleanArchitecture.Infrastructure.Singleton; 3 | using CleanArchitecture.BoundedContext.Singleton; 4 | using RxWeb.Core.Data; 5 | 6 | namespace CleanArchitecture.Api.Bootstrap 7 | { 8 | public static class Singleton 9 | { 10 | public static void AddSingletonService(this IServiceCollection serviceCollection) { 11 | #region Singleton 12 | serviceCollection.AddSingleton(); 13 | serviceCollection.AddSingleton(typeof(UserAccessConfigInfo)); 14 | #endregion Singleton 15 | } 16 | 17 | } 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace CleanArchitecture.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Database": { 3 | "MultiTenant": { 4 | "SchemaBased": { 5 | "ConfigFromDb": false, 6 | "HostUriSchemaMappings": {} 7 | }, 8 | "DatabaseBased": { 9 | "ConfigFromDb": false, 10 | "HostUriConnectionMappings": {} 11 | }, 12 | "TenantColumnName": "" 13 | }, 14 | "ConnectionString": { 15 | "Main": "", 16 | "Log": "", 17 | }, 18 | "CommandTimeout": 100, 19 | "ConnectionResiliency": { 20 | "MaxRetryCount": 2, 21 | "MaxRetryDelay": 20 22 | } 23 | }, 24 | "Security": { 25 | "AllowedHosts": [ "http://localhost:4200" ], 26 | "AllowedIps": [] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Api/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.BoundedContext/CleanArchitecture.BoundedContext.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.BoundedContext/SqlDbContext/LogSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using CleanArchitecture.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace CleanArchitecture.BoundedContext.SqlContext 11 | { 12 | public class LogSqlDbContext : BaseDbContext, ILogDatabaseFacade, IDisposable 13 | { 14 | public LogSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Log")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.BoundedContext/SqlDbContext/MainSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using CleanArchitecture.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace CleanArchitecture.BoundedContext.SqlContext 11 | { 12 | public class MainSqlDbContext : BaseDbContext, IMainDatabaseFacade, IDisposable 13 | { 14 | public MainSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Main")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | netcoreapp3.1 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Infrastructure/CleanArchitecture.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | netcoreapp3.1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/CleanArchitecture.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/Enums/Main/Status.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArchitecture.Models.Enums.Main 2 | { 3 | public enum Status 4 | { 5 | Active = 1, 6 | InActive = 3, 7 | Deleted = 4, 8 | } 9 | } -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/Interface/ILogDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace CleanArchitecture.BoundedContext.SqlContext 4 | { 5 | public interface ILogDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/Interface/IMainDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace CleanArchitecture.BoundedContext.SqlContext 4 | { 5 | public interface IMainDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/Models/SecurityConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CleanArchitecture.Models 4 | { 5 | public class SecurityConfig 6 | { 7 | public string[] AllowedHosts { get; set; } 8 | 9 | public string[] AllowedIps { get; set; } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/ViewModels/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace CleanArchitecture.Models.ViewModels 4 | { 5 | 6 | public partial class AuthenticationModel 7 | { 8 | [Required] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | public string Password { get; set; } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/ViewModels/StoreProcResult.cs: -------------------------------------------------------------------------------- 1 | namespace CleanArchitecture.Models.ViewModels 2 | { 3 | public class StoreProcResult 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Result { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.Models/ViewModels/UserConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace CleanArchitecture.Models.ViewModels 3 | { 4 | public class UserConfig 5 | { 6 | 7 | public string AudienceType { get; set; } 8 | 9 | public string LanguageCode { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.UnitOfWork/BaseUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | 3 | namespace CleanArchitecture.UnitOfWork 4 | { 5 | public class BaseUow : CoreUnitOfWork 6 | { 7 | public BaseUow(IDbContext context, IRepositoryProvider repositoryProvider,IAuditLog auditLog = null) : base(context, repositoryProvider,auditLog) { } 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.UnitOfWork/CleanArchitecture.UnitOfWork.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | netcoreapp3.1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/CleanArchitecture.UnitOfWork/Main/LoginUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using CleanArchitecture.BoundedContext.Main; 3 | 4 | namespace CleanArchitecture.UnitOfWork.Main 5 | { 6 | public class LoginUow : BaseUow, ILoginUow 7 | { 8 | public LoginUow(ILoginContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ILoginUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/ProjectTemplates/AspNetCore/cli/CleanArchitecture/icon.png -------------------------------------------------------------------------------- /src/ProjectTemplates/AspNetCore/cli/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/ProjectTemplates/AspNetCore/cli/icon.png -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/Bootstrap/AddDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using NewProjectSolution.BoundedContext.SqlContext; 3 | 4 | namespace NewProjectSolution.Api.Bootstrap 5 | { 6 | public static class AddDbContextExtension 7 | { 8 | public static void AddDbContextService(this IServiceCollection serviceCollection) 9 | { 10 | #region SqlDbContext 11 | serviceCollection.AddDbContext(); 12 | serviceCollection.AddScoped(); 13 | serviceCollection.AddDbContext(); 14 | serviceCollection.AddScoped(); 15 | #endregion SqlDbContext 16 | } 17 | } 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/Bootstrap/ConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using NewProjectSolution.Models; 4 | using RxWeb.Core.Data.Models; 5 | 6 | namespace NewProjectSolution.Api.Bootstrap 7 | { 8 | public static class ConfigurationOptions 9 | { 10 | public static void AddConfigurationOptions(this IServiceCollection serviceCollection, IConfiguration configuration) { 11 | #region ConfigurationOptions 12 | serviceCollection.Configure(configuration.GetSection("Database")); 13 | serviceCollection.Configure(configuration.GetSection("Security")); 14 | #endregion ConfigurationOptions 15 | } 16 | } 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/Bootstrap/Singleton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using NewProjectSolution.Infrastructure.Singleton; 3 | using NewProjectSolution.BoundedContext.Singleton; 4 | using RxWeb.Core.Data; 5 | 6 | namespace NewProjectSolution.Api.Bootstrap 7 | { 8 | public static class Singleton 9 | { 10 | public static void AddSingletonService(this IServiceCollection serviceCollection) { 11 | #region Singleton 12 | serviceCollection.AddSingleton(); 13 | serviceCollection.AddSingleton(typeof(UserAccessConfigInfo)); 14 | #endregion Singleton 15 | } 16 | 17 | } 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace NewProjectSolution.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization.rar -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization/AppComponent-en.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "userName_p": "Enter Your UserName", 4 | "userName_t": "User Name" 5 | } -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization/AppComponent-fr.json: -------------------------------------------------------------------------------- 1 | {"userName_p":"","userName_t":""} -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization/global-en.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "maxLength": "The allowed max length is {0}", 4 | "range": "You can enter {0} to {1} length", 5 | "required": "The {0} field is required", 6 | "unique": "The {0} Field Should be unique", 7 | "validationTitle": "This model has been failed." 8 | } -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization/global-fr.json: -------------------------------------------------------------------------------- 1 | {"maxLength":"","range":"","required":"","unique":""} -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization/master.activity-log-types.list-en.json: -------------------------------------------------------------------------------- 1 | {"systemKeyword.l":"System Type","systemKeyword.p":"Enter the System Type","systemKeyword.g":"Enter The Text"} -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Api/wwwroot/localization/master.activity-log-types.list-fr.json: -------------------------------------------------------------------------------- 1 | {"systemKeyword.l":"","systemKeyword.p":"","systemKeyword.g":""} -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.BoundedContext/NewProjectSolution.BoundedContext.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.BoundedContext/SqlDbContext/LogSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.Extensions.Options; 4 | using NewProjectSolution.BoundedContext.Singleton; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace NewProjectSolution.BoundedContext.SqlContext 11 | { 12 | public class LogSqlDbContext : BaseDbContext, ILogDatabaseFacade, IDisposable 13 | { 14 | public LogSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) :base(databaseConfig, contextAccessor,tenantDbConnection){} 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Log")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.BoundedContext/SqlDbContext/MainSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.Extensions.Options; 4 | using NewProjectSolution.BoundedContext.Singleton; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace NewProjectSolution.BoundedContext.SqlContext 11 | { 12 | public class MainSqlDbContext : BaseDbContext, IMainDatabaseFacade, IDisposable 13 | { 14 | public MainSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) :base(databaseConfig, contextAccessor,tenantDbConnection){} 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Main")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Domain/NewProjectSolution.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Infrastructure/NewProjectSolution.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/Enums/Main/Status.cs: -------------------------------------------------------------------------------- 1 | namespace NewProjectSolution.Models.Enums.Main 2 | { 3 | public enum Status 4 | { 5 | Active = 1, 6 | InActive = 3, 7 | Deleted = 4, 8 | } 9 | } -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/Interface/ILogDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace NewProjectSolution.BoundedContext.SqlContext 4 | { 5 | public interface ILogDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/Interface/IMainDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace NewProjectSolution.BoundedContext.SqlContext 4 | { 5 | public interface IMainDatabaseFacade :IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/Models/SecurityConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NewProjectSolution.Models 2 | { 3 | public class SecurityConfig 4 | { 5 | public string[] AllowedHosts { get; set; } 6 | 7 | public string[] AllowedIps { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/ViewModels/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | 2 | using RxWeb.Core.Annotations; 3 | 4 | namespace NewProjectSolution.Models.ViewModels 5 | { 6 | public partial class AuthenticationModel 7 | { 8 | 9 | [Required] 10 | public string UserName { get; set; } 11 | 12 | [Required] 13 | public string Password { get; set; } 14 | 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/ViewModels/StoreProcResult.cs: -------------------------------------------------------------------------------- 1 | namespace NewProjectSolution.Models.ViewModels 2 | { 3 | public class StoreProcResult 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Result { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.Models/ViewModels/UserConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using RxWeb.Core.Annotations; 3 | 4 | namespace NewProjectSolution.Models.ViewModels 5 | { 6 | public class UserConfig 7 | { 8 | [Required] 9 | public string AudienceType { get; set; } 10 | 11 | public string LanguageCode { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.UnitOfWork/BaseUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | 3 | namespace NewProjectSolution.UnitOfWork 4 | { 5 | public class BaseUow : CoreUnitOfWork 6 | { 7 | public BaseUow(IDbContext context, IRepositoryProvider repositoryProvider,IAuditLog auditLog = null) : base(context, repositoryProvider,auditLog) { } 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.UnitOfWork/Main/LoginUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using NewProjectSolution.BoundedContext.Main; 3 | 4 | namespace NewProjectSolution.UnitOfWork.Main 5 | { 6 | public class LoginUow : BaseUow, ILoginUow 7 | { 8 | public LoginUow(ILoginContext context, IRepositoryProvider repositoryProvider,IAuditLog auditLog) : base(context, repositoryProvider,auditLog) { } 9 | } 10 | 11 | public interface ILoginUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.UnitOfWork/Main/MasterUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using NewProjectSolution.BoundedContext.Main; 3 | 4 | namespace NewProjectSolution.UnitOfWork.Main 5 | { 6 | public class MasterUow : BaseUow, IMasterUow 7 | { 8 | public MasterUow(IMasterContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface IMasterUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/NewProjectSolution.UnitOfWork/NewProjectSolution.UnitOfWork.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/rxweb-tool/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "api": "NewProjectSolution.Api", 4 | "model": "NewProjectSolution.Models", 5 | "context": "NewProjectSolution.BoundedContext", 6 | "domain": "NewProjectSolution.Domain", 7 | "unitOfWork": "NewProjectSolution.UnitOfWork", 8 | "infrastructure": "NewProjectSolution.Infrastructure", 9 | "azureFunctionHttp":"", 10 | "portal":"", 11 | "azureFunctionBackground":"" 12 | }, 13 | "path": { 14 | "dbConnection": { 15 | "main": "Database.ConnectionString.Main" 16 | }, 17 | "folder": { 18 | "model": "DbEntities", 19 | "context": "", 20 | "enums": "", 21 | "localizeValidationMessage": "wwwroot" 22 | } 23 | }, 24 | "annotations": { 25 | "rxweb": false 26 | }, 27 | "config": { 28 | "generateEnums": false, 29 | "commanTableSchema": "dbo", 30 | "validationMessageLocalizationId": "15" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/RxWebCoreSample/rxweb-tool/controllers.main.json: -------------------------------------------------------------------------------- 1 | {"Users":{"type":"","parent":null},"UserRoles":{"type":"Domain","parent":null},"Persons":{"type":"","parent":null}} -------------------------------------------------------------------------------- /src/RxWebCoreSample/rxweb-tool/models.log.json: -------------------------------------------------------------------------------- 1 | [{"Name":"AuditRecordDetails","Auditable":false,"PrimaryTextColumnName":null,"Keys":["AuditRecordDetailId"]},{"Name":"AuditRecords","Auditable":false,"PrimaryTextColumnName":null,"Keys":["AuditRecordId"]},{"Name":"AuditRequests","Auditable":false,"PrimaryTextColumnName":null,"Keys":["AuditRequestId"]},{"Name":"ExceptionLogs","Auditable":false,"PrimaryTextColumnName":null,"Keys":["ExceptionLogId"]},{"Name":"RequestTraces","Auditable":false,"PrimaryTextColumnName":null,"Keys":["TraceId"]}] -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Bootstrap/AddDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using HumanResourceApplication.BoundedContext.SqlContext; 3 | 4 | namespace HumanResourceApplication.Api.Bootstrap 5 | { 6 | public static class AddDbContextExtension 7 | { 8 | public static void AddDbContextService(this IServiceCollection serviceCollection) 9 | { 10 | #region SqlDbContext 11 | serviceCollection.AddDbContext(); 12 | serviceCollection.AddScoped(); 13 | serviceCollection.AddDbContext(); 14 | serviceCollection.AddScoped(); 15 | #endregion SqlDbContext 16 | 17 | 18 | 19 | } 20 | } 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Bootstrap/ConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | using HumanResourceApplication.Models; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using RxWeb.Core.Data.Models; 5 | 6 | namespace HumanResourceApplication.Api.Bootstrap 7 | { 8 | public static class ConfigurationOptions 9 | { 10 | public static void AddConfigurationOptions(this IServiceCollection serviceCollection, IConfiguration configuration) 11 | { 12 | #region ConfigurationOptions 13 | serviceCollection.Configure(configuration.GetSection("Database")); 14 | serviceCollection.Configure(configuration.GetSection("Security")); 15 | #endregion ConfigurationOptions 16 | } 17 | } 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Bootstrap/Singleton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using HumanResourceApplication.Infrastructure.Singleton; 3 | using HumanResourceApplication.BoundedContext.Singleton; 4 | using RxWeb.Core.Data; 5 | 6 | namespace HumanResourceApplication.Api.Bootstrap 7 | { 8 | public static class Singleton 9 | { 10 | public static void AddSingletonService(this IServiceCollection serviceCollection) 11 | { 12 | #region Singleton 13 | serviceCollection.AddSingleton(); 14 | serviceCollection.AddSingleton(typeof(UserAccessConfigInfo)); 15 | #endregion Singleton 16 | } 17 | 18 | } 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Controllers/Api/CandidateModule/CandidateAvailabilitiesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Linq; 3 | using HumanResourceApplication.UnitOfWork.Main; 4 | using HumanResourceApplication.Models.Main; 5 | using RxWeb.Core.AspNetCore; 6 | using RxWeb.Core.Security.Authorization; 7 | 8 | namespace HumanResourceApplication.Api.Controllers.CandidateModule 9 | { 10 | [ApiController] 11 | [Route("api/candidates/[controller]")] 12 | public class CandidateAvailabilitiesController : BaseController 13 | { 14 | public CandidateAvailabilitiesController(ICandidateUow uow) : base(uow) { } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Controllers/Api/CandidateModule/CandidatesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Linq; 3 | using HumanResourceApplication.UnitOfWork.Main; 4 | using HumanResourceApplication.Models.Main; 5 | using RxWeb.Core.AspNetCore; 6 | using RxWeb.Core.Security.Authorization; 7 | 8 | namespace HumanResourceApplication.Api.Controllers.CandidateModule 9 | { 10 | [ApiController] 11 | [Route("api/[controller]")] 12 | 13 | public class CandidatesController : BaseController 14 | 15 | { 16 | public CandidatesController(ICandidateUow uow):base(uow) {} 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Controllers/Api/Lookups/Main/CountryLookupsController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Linq; 3 | using HumanResourceApplication.UnitOfWork.Main; 4 | using HumanResourceApplication.Models.Main; 5 | using RxWeb.Core.AspNetCore; 6 | using RxWeb.Core.Security.Authorization; 7 | 8 | namespace HumanResourceApplication.Api.Controllers.UserModule 9 | { 10 | [ApiController] 11 | [Route("api/[controller]")] 12 | public class CountryLookupsController : BaseLookupController 13 | { 14 | public CountryLookupsController(IUserUow uow) : base(uow) { } 15 | 16 | #region Lookups 17 | [HttpGet("CountryLookups")] 18 | public IQueryable GetCountryLookups() 19 | { 20 | return Uow.Repository().Queryable(); 21 | } 22 | #endregion Lookups 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Controllers/Api/UserModule/UsersController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Linq; 3 | using HumanResourceApplication.Domain.UserModule; 4 | using HumanResourceApplication.Models.Main; 5 | using RxWeb.Core.AspNetCore; 6 | using RxWeb.Core.Security.Authorization; 7 | 8 | namespace HumanResourceApplication.Api.Controllers.UserModule 9 | { 10 | [ApiController] 11 | [Route("api/[controller]")] 12 | 13 | public class UsersController : BaseDomainController 14 | 15 | { 16 | public UsersController(IUserDomain domain):base(domain) {} 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace HumanResourceApplication.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Api/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.BoundedContext/HumanResourceApplication.BoundedContext.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.BoundedContext/SqlDbContext/LogSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using HumanResourceApplication.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace HumanResourceApplication.BoundedContext.SqlContext 11 | { 12 | public class LogSqlDbContext : BaseDbContext, ILogDatabaseFacade, IDisposable 13 | { 14 | public LogSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Log")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.BoundedContext/SqlDbContext/MainSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using HumanResourceApplication.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace HumanResourceApplication.BoundedContext.SqlContext 11 | { 12 | public class MainSqlDbContext : BaseDbContext, IMainDatabaseFacade, IDisposable 13 | { 14 | public MainSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Main")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Domain/HumanResourceApplication.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | netcoreapp3.1 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Infrastructure/HumanResourceApplication.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | netcoreapp3.1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/DbEntities/Main/vCountryLookup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using RxWeb.Core.Annotations; 5 | using RxWeb.Core.Data.Annotations; 6 | using RxWeb.Core.Sanitizers; 7 | using HumanResourceApplication.BoundedContext.SqlContext; 8 | namespace HumanResourceApplication.Models.Main 9 | { 10 | [Table("vCountryLookups",Schema="dbo")] 11 | public partial class vCountryLookup 12 | { 13 | #region CountryId Annotations 14 | 15 | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 16 | [System.ComponentModel.DataAnnotations.Key] 17 | #endregion CountryId Annotations 18 | 19 | public int CountryId { get; set; } 20 | 21 | 22 | public string CountryName { get; set; } 23 | 24 | 25 | public vCountryLookup() 26 | { 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/DbEntities/Main/vStateRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using RxWeb.Core.Annotations; 5 | using RxWeb.Core.Data.Annotations; 6 | using RxWeb.Core.Sanitizers; 7 | using HumanResourceApplication.BoundedContext.SqlContext; 8 | namespace HumanResourceApplication.Models.Main 9 | { 10 | [Table("vStateRecords",Schema="dbo")] 11 | public partial class vStateRecord 12 | { 13 | #region StateId Annotations 14 | 15 | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 16 | [System.ComponentModel.DataAnnotations.Key] 17 | #endregion StateId Annotations 18 | 19 | public int StateId { get; set; } 20 | 21 | 22 | public string StateName { get; set; } 23 | 24 | 25 | public int StatusId { get; set; } 26 | 27 | 28 | public vStateRecord() 29 | { 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/Enums/Main/Status.cs: -------------------------------------------------------------------------------- 1 | namespace HumanResourceApplication.Models.Enums.Main 2 | { 3 | public enum Status 4 | { 5 | Active = 1, 6 | InActive = 3, 7 | Deleted = 4, 8 | } 9 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/ExtendedModels/Main/EncryptDecryptConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 2 | using System; 3 | using System.Linq.Expressions; 4 | 5 | public class EncryptDecryptConverter : ValueConverter 6 | { 7 | public static Expression> ConvertToProviderExpressions => (v) => ConvertToProviderExpressionsValue(v); 8 | 9 | public static Expression> ConvertFromProviderExpressions => (v) => ConvertFromProviderExpressionsValue(v); 10 | 11 | public static string ConvertToProviderExpressionsValue(string str) 12 | { 13 | return "XXXX"; 14 | } 15 | 16 | public static string ConvertFromProviderExpressionsValue(string str) 17 | { 18 | return "XXXX"; 19 | } 20 | 21 | public EncryptDecryptConverter() 22 | : base(ConvertToProviderExpressions, ConvertFromProviderExpressions) { } 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/HumanResourceApplication.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/Interface/ILogDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace HumanResourceApplication.BoundedContext.SqlContext 4 | { 5 | public interface ILogDatabaseFacade : IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/Interface/IMainDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace HumanResourceApplication.BoundedContext.SqlContext 4 | { 5 | public interface IMainDatabaseFacade : IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/Models/SecurityConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HumanResourceApplication.Models 4 | { 5 | public class SecurityConfig 6 | { 7 | public string[] AllowedHosts { get; set; } 8 | 9 | public string[] AllowedIps { get; set; } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/ViewModels/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace HumanResourceApplication.Models.ViewModels 4 | { 5 | 6 | public partial class AuthenticationModel 7 | { 8 | [Required] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | public string Password { get; set; } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/ViewModels/StoreProcResult.cs: -------------------------------------------------------------------------------- 1 | namespace HumanResourceApplication.Models.ViewModels 2 | { 3 | public class StoreProcResult 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Result { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.Models/ViewModels/UserConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace HumanResourceApplication.Models.ViewModels 3 | { 4 | public class UserConfig 5 | { 6 | 7 | public string AudienceType { get; set; } 8 | 9 | public string LanguageCode { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.UnitOfWork/BaseUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | 3 | namespace HumanResourceApplication.UnitOfWork 4 | { 5 | public class BaseUow : CoreUnitOfWork 6 | { 7 | public BaseUow(IDbContext context, IRepositoryProvider repositoryProvider, IAuditLog auditLog = null) : base(context, repositoryProvider, auditLog) { } 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.UnitOfWork/HumanResourceApplication.UnitOfWork.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | netcoreapp3.1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.UnitOfWork/Main/CandidateLookupUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using HumanResourceApplication.BoundedContext.Main; 3 | 4 | namespace HumanResourceApplication.UnitOfWork.Main 5 | { 6 | public class CandidateLookupUow : BaseUow, ICandidateLookupUow 7 | { 8 | public CandidateLookupUow(ICandidateLookupContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ICandidateLookupUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.UnitOfWork/Main/CandidateUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using HumanResourceApplication.BoundedContext.Main; 3 | 4 | namespace HumanResourceApplication.UnitOfWork.Main 5 | { 6 | public class CandidateUow : BaseUow, ICandidateUow 7 | { 8 | public CandidateUow(ICandidateContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ICandidateUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.UnitOfWork/Main/LoginUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using HumanResourceApplication.BoundedContext.Main; 3 | 4 | namespace HumanResourceApplication.UnitOfWork.Main 5 | { 6 | public class LoginUow : BaseUow, ILoginUow 7 | { 8 | public LoginUow(ILoginContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ILoginUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/HumanResourceApplication.UnitOfWork/Main/UserUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using HumanResourceApplication.BoundedContext.Main; 3 | 4 | namespace HumanResourceApplication.UnitOfWork.Main 5 | { 6 | public class UserUow : BaseUow, IUserUow 7 | { 8 | public UserUow(IUserContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface IUserUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/Scripts/humanresource-log.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/Scripts/humanresource-log.sql -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/Scripts/humanresource.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/Scripts/humanresource.sql -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/rxweb-tool/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "api": "HumanResourceApplication.Api", 4 | "model": "HumanResourceApplication.Models", 5 | "context": "HumanResourceApplication.BoundedContext", 6 | "domain": "HumanResourceApplication.Domain", 7 | "unitOfWork": "HumanResourceApplication.UnitOfWork", 8 | "infrastructure": "HumanResourceApplication.Infrastructure", 9 | "azureFunctionHttp":"", 10 | "portal":"", 11 | "azureFunctionBackground":"" 12 | }, 13 | "path": { 14 | "dbConnection": { 15 | "main": "Database.ConnectionString.Main" 16 | }, 17 | "folder": { 18 | "model": "DbEntities", 19 | "context": "", 20 | "enums": "", 21 | "localizeValidationMessage": "wwwroot" 22 | } 23 | }, 24 | "annotations": { 25 | "rxweb": false 26 | }, 27 | "config": { 28 | "generateEnums": false, 29 | "commanTableSchema": "dbo", 30 | "validationMessageLocalizationId": "15" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/rxweb-tool/controllers.main.json: -------------------------------------------------------------------------------- 1 | {"Candidates":{"type":"","parent":null},"Users":{"type":"Domain","parent":null},"CandidateAvailabilities":{"type":"","parent":null},"UsersSearch":{"type":"Search","parent":null},"CountryLookups":{"type":"Lookup","parent":null}} -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/rxweb-tool/lookups.main.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/collections/status.collection.ts: -------------------------------------------------------------------------------- 1 | export const STATUS = [ 2 | { 3 | id : 1, 4 | name : 'Active' 5 | }, 6 | { 7 | id : 3, 8 | name : 'InActive' 9 | }, 10 | { 11 | id : 4, 12 | name : 'Deleted' 13 | }, 14 | ] -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/enums/status.enum.ts: -------------------------------------------------------------------------------- 1 | export enum StatusEnum { 2 | Active = 1, 3 | InActive = 3, 4 | Deleted = 4, 5 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/application-locale-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class ApplicationLocaleBase { 6 | 7 | //#region applicationLocaleId Prop 8 | @prop() 9 | applicationLocaleId : number; 10 | //#endregion applicationLocaleId Prop 11 | 12 | 13 | //#region localeCode Prop 14 | @required() 15 | @maxLength({value:50}) 16 | localeCode : string; 17 | //#endregion localeCode Prop 18 | 19 | 20 | //#region localeName Prop 21 | @required() 22 | @maxLength({value:300}) 23 | localeName : string; 24 | //#endregion localeName Prop 25 | 26 | 27 | //#region statusId Prop 28 | @range({minimumNumber:1,maximumNumber:2147483647}) 29 | @required() 30 | statusId : number; 31 | //#endregion statusId Prop 32 | 33 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/application-module-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class ApplicationModuleBase { 6 | 7 | //#region applicationModuleId Prop 8 | @prop() 9 | applicationModuleId : number; 10 | //#endregion applicationModuleId Prop 11 | 12 | 13 | //#region moduleMasterId Prop 14 | @range({minimumNumber:1,maximumNumber:2147483647}) 15 | @required() 16 | moduleMasterId : number; 17 | //#endregion moduleMasterId Prop 18 | 19 | 20 | //#region parentApplicationModuleId Prop 21 | @prop() 22 | parentApplicationModuleId : number; 23 | //#endregion parentApplicationModuleId Prop 24 | 25 | 26 | 27 | 28 | 29 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/application-object-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class ApplicationObjectBase { 6 | 7 | //#region applicationObjectId Prop 8 | @prop() 9 | applicationObjectId : number; 10 | //#endregion applicationObjectId Prop 11 | 12 | 13 | //#region applicationObjectTypeId Prop 14 | @range({minimumNumber:1,maximumNumber:2147483647}) 15 | @required() 16 | applicationObjectTypeId : number; 17 | //#endregion applicationObjectTypeId Prop 18 | 19 | 20 | //#region applicationObjectName Prop 21 | @required() 22 | @maxLength({value:100}) 23 | applicationObjectName : string; 24 | //#endregion applicationObjectName Prop 25 | 26 | 27 | //#region statusId Prop 28 | @range({minimumNumber:1,maximumNumber:2147483647}) 29 | @required() 30 | statusId : number; 31 | //#endregion statusId Prop 32 | 33 | 34 | 35 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/application-object-type-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class ApplicationObjectTypeBase { 6 | 7 | //#region applicationObjectTypeId Prop 8 | @prop() 9 | applicationObjectTypeId : number; 10 | //#endregion applicationObjectTypeId Prop 11 | 12 | 13 | //#region applicationObjectTypeName Prop 14 | @required() 15 | @maxLength({value:100}) 16 | applicationObjectTypeName : string; 17 | //#endregion applicationObjectTypeName Prop 18 | 19 | 20 | //#region statusId Prop 21 | @range({minimumNumber:1,maximumNumber:2147483647}) 22 | @required() 23 | statusId : number; 24 | //#endregion statusId Prop 25 | 26 | 27 | 28 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/application-time-zone-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class ApplicationTimeZoneBase { 6 | 7 | //#region applicationTimeZoneId Prop 8 | @prop() 9 | applicationTimeZoneId : number; 10 | //#endregion applicationTimeZoneId Prop 11 | 12 | 13 | //#region applicationTimeZoneName Prop 14 | @required() 15 | @maxLength({value:100}) 16 | applicationTimeZoneName : string; 17 | //#endregion applicationTimeZoneName Prop 18 | 19 | 20 | //#region comment Prop 21 | @required() 22 | @maxLength({value:200}) 23 | comment : string; 24 | //#endregion comment Prop 25 | 26 | 27 | //#region statusId Prop 28 | @range({minimumNumber:1,maximumNumber:2147483647}) 29 | @required() 30 | statusId : number; 31 | //#endregion statusId Prop 32 | 33 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/candidate-availability-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class CandidateAvailabilityBase { 6 | 7 | //#region candidateAvailabilityId Prop 8 | @prop() 9 | candidateAvailabilityId : number; 10 | //#endregion candidateAvailabilityId Prop 11 | 12 | 13 | //#region availableDate Prop 14 | @required() 15 | availableDate : any; 16 | //#endregion availableDate Prop 17 | 18 | 19 | //#region fromTime Prop 20 | @required() 21 | fromTime : any; 22 | //#endregion fromTime Prop 23 | 24 | 25 | //#region toTime Prop 26 | @required() 27 | toTime : any; 28 | //#endregion toTime Prop 29 | 30 | 31 | //#region candidateId Prop 32 | @range({minimumNumber:1,maximumNumber:2147483647}) 33 | @required() 34 | candidateId : number; 35 | //#endregion candidateId Prop 36 | 37 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/country-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class CountryBase { 6 | 7 | //#region countryId Prop 8 | @range({minimumNumber:1,maximumNumber:2147483647}) 9 | @required() 10 | countryId : number; 11 | //#endregion countryId Prop 12 | 13 | 14 | //#region countryName Prop 15 | @required() 16 | @maxLength({value:100}) 17 | countryName : string; 18 | //#endregion countryName Prop 19 | 20 | 21 | //#region statusId Prop 22 | @range({minimumNumber:1,maximumNumber:2147483647}) 23 | @required() 24 | statusId : number; 25 | //#endregion statusId Prop 26 | 27 | 28 | //#region languageId Prop 29 | @range({minimumNumber:1,maximumNumber:2147483647}) 30 | @required() 31 | languageId : number; 32 | //#endregion languageId Prop 33 | 34 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/language-content-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class LanguageContentBase { 6 | 7 | //#region languageContentId Prop 8 | @prop() 9 | languageContentId : number; 10 | //#endregion languageContentId Prop 11 | 12 | 13 | //#region languageContentKeyId Prop 14 | @range({minimumNumber:1,maximumNumber:2147483647}) 15 | @required() 16 | languageContentKeyId : number; 17 | //#endregion languageContentKeyId Prop 18 | 19 | 20 | //#region contentType Prop 21 | @required() 22 | @maxLength({value:3}) 23 | contentType : string; 24 | //#endregion contentType Prop 25 | 26 | 27 | //#region en Prop 28 | @required() 29 | en : string; 30 | //#endregion en Prop 31 | 32 | 33 | //#region fr Prop 34 | @prop() 35 | fr : string; 36 | //#endregion fr Prop 37 | 38 | 39 | 40 | 41 | 42 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/language-content-key-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class LanguageContentKeyBase { 6 | 7 | //#region languageContentKeyId Prop 8 | @prop() 9 | languageContentKeyId : number; 10 | //#endregion languageContentKeyId Prop 11 | 12 | 13 | //#region keyName Prop 14 | @required() 15 | @maxLength({value:50}) 16 | keyName : string; 17 | //#endregion keyName Prop 18 | 19 | 20 | //#region isComponent Prop 21 | @required() 22 | isComponent : boolean; 23 | //#endregion isComponent Prop 24 | 25 | 26 | 27 | 28 | 29 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/module-master-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class ModuleMasterBase { 6 | 7 | //#region moduleMasterId Prop 8 | @prop() 9 | moduleMasterId : number; 10 | //#endregion moduleMasterId Prop 11 | 12 | 13 | //#region moduleMasterName Prop 14 | @required() 15 | @maxLength({value:100}) 16 | moduleMasterName : string; 17 | //#endregion moduleMasterName Prop 18 | 19 | 20 | //#region statusId Prop 21 | @range({minimumNumber:1,maximumNumber:2147483647}) 22 | @required() 23 | statusId : number; 24 | //#endregion statusId Prop 25 | 26 | 27 | 28 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/role-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class RoleBase { 6 | 7 | //#region roleId Prop 8 | @prop() 9 | roleId : number; 10 | //#endregion roleId Prop 11 | 12 | 13 | //#region roleName Prop 14 | @required() 15 | @maxLength({value:50}) 16 | roleName : string; 17 | //#endregion roleName Prop 18 | 19 | 20 | //#region statusId Prop 21 | @range({minimumNumber:1,maximumNumber:2147483647}) 22 | @required() 23 | statusId : number; 24 | //#endregion statusId Prop 25 | 26 | 27 | 28 | 29 | 30 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/state-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class StateBase { 6 | 7 | //#region stateId Prop 8 | @range({minimumNumber:1,maximumNumber:2147483647}) 9 | @required() 10 | stateId : number; 11 | //#endregion stateId Prop 12 | 13 | 14 | //#region stateName Prop 15 | @required() 16 | @maxLength({value:100}) 17 | stateName : string; 18 | //#endregion stateName Prop 19 | 20 | 21 | //#region statusId Prop 22 | @range({minimumNumber:1,maximumNumber:2147483647}) 23 | @required() 24 | statusId : number; 25 | //#endregion statusId Prop 26 | 27 | 28 | //#region countryId Prop 29 | @range({minimumNumber:1,maximumNumber:2147483647}) 30 | @required() 31 | countryId : number; 32 | //#endregion countryId Prop 33 | 34 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/user-role-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class UserRoleBase { 6 | 7 | //#region userRoleId Prop 8 | @prop() 9 | userRoleId : number; 10 | //#endregion userRoleId Prop 11 | 12 | 13 | //#region userId Prop 14 | @range({minimumNumber:1,maximumNumber:2147483647}) 15 | @required() 16 | userId : number; 17 | //#endregion userId Prop 18 | 19 | 20 | //#region roleId Prop 21 | @range({minimumNumber:1,maximumNumber:2147483647}) 22 | @required() 23 | roleId : number; 24 | //#endregion roleId Prop 25 | 26 | 27 | 28 | 29 | 30 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/v-country-lookup-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class vCountryLookupBase { 6 | 7 | //#region countryId Prop 8 | @gridColumn({visible: true, columnIndex:0, allowSorting: true, headerKey: 'countryId', keyColumn: true}) 9 | countryId : number; 10 | //#endregion countryId Prop 11 | 12 | 13 | //#region countryName Prop 14 | @gridColumn({visible: true, columnIndex:1, allowSorting: true, headerKey: 'countryName', keyColumn: false}) 15 | countryName : string; 16 | //#endregion countryName Prop 17 | 18 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/database-models/v-state-record-base.ts: -------------------------------------------------------------------------------- 1 | import { prop,propObject,propArray,required,maxLength,range } from "@rxweb/reactive-form-validators" 2 | import { gridColumn } from "@rxweb/grid" 3 | 4 | 5 | export class vStateRecordBase { 6 | 7 | //#region stateId Prop 8 | @gridColumn({visible: true, columnIndex:0, allowSorting: true, headerKey: 'stateId', keyColumn: true}) 9 | stateId : number; 10 | //#endregion stateId Prop 11 | 12 | 13 | //#region stateName Prop 14 | @gridColumn({visible: true, columnIndex:1, allowSorting: true, headerKey: 'stateName', keyColumn: false}) 15 | stateName : string; 16 | //#endregion stateName Prop 17 | 18 | 19 | //#region statusId Prop 20 | @gridColumn({visible: true, columnIndex:2, allowSorting: true, headerKey: 'statusId', keyColumn: false}) 21 | statusId : number; 22 | //#endregion statusId Prop 23 | 24 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/application-locale.ts: -------------------------------------------------------------------------------- 1 | import {ApplicationLocaleBase} from '../database-models/application-locale-base'; 2 | //Generated Imports 3 | export class ApplicationLocale extends ApplicationLocaleBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/application-module.ts: -------------------------------------------------------------------------------- 1 | import {ApplicationModuleBase} from '../database-models/application-module-base'; 2 | import {ModuleMasterBase} from '../database-models/module-master-base'; 3 | import {RolePermissionBase} from '../database-models/role-permission-base'; 4 | //Generated Imports 5 | export class ApplicationModule extends ApplicationModuleBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region moduleMaster Prop 13 | moduleMaster : ModuleMasterBase; 14 | //#endregion moduleMaster Prop 15 | //#region rolePermissions Prop 16 | rolePermissions : RolePermissionBase[]; 17 | //#endregion rolePermissions Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/application-object-type.ts: -------------------------------------------------------------------------------- 1 | import {ApplicationObjectTypeBase} from '../database-models/application-object-type-base'; 2 | import {ApplicationObjectBase} from '../database-models/application-object-base'; 3 | //Generated Imports 4 | export class ApplicationObjectType extends ApplicationObjectTypeBase 5 | { 6 | 7 | 8 | 9 | 10 | //#region Generated Reference Properties 11 | //#region applicationObjects Prop 12 | applicationObjects : ApplicationObjectBase[]; 13 | //#endregion applicationObjects Prop 14 | 15 | //#endregion Generated Reference Properties 16 | 17 | 18 | 19 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/application-object.ts: -------------------------------------------------------------------------------- 1 | import {ApplicationObjectBase} from '../database-models/application-object-base'; 2 | import {ApplicationObjectTypeBase} from '../database-models/application-object-type-base'; 3 | //Generated Imports 4 | export class ApplicationObject extends ApplicationObjectBase 5 | { 6 | 7 | 8 | 9 | 10 | //#region Generated Reference Properties 11 | //#region applicationObjectType Prop 12 | applicationObjectType : ApplicationObjectTypeBase; 13 | //#endregion applicationObjectType Prop 14 | 15 | //#endregion Generated Reference Properties 16 | 17 | 18 | 19 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/application-time-zone.ts: -------------------------------------------------------------------------------- 1 | import {ApplicationTimeZoneBase} from '../database-models/application-time-zone-base'; 2 | //Generated Imports 3 | export class ApplicationTimeZone extends ApplicationTimeZoneBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/application-user-token.ts: -------------------------------------------------------------------------------- 1 | import {ApplicationUserTokenBase} from '../database-models/application-user-token-base'; 2 | import {UserBase} from '../database-models/user-base'; 3 | //Generated Imports 4 | export class ApplicationUserToken extends ApplicationUserTokenBase 5 | { 6 | 7 | 8 | 9 | 10 | //#region Generated Reference Properties 11 | //#region user Prop 12 | user : UserBase; 13 | //#endregion user Prop 14 | 15 | //#endregion Generated Reference Properties 16 | 17 | 18 | 19 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/candidate-availability.ts: -------------------------------------------------------------------------------- 1 | import {CandidateAvailabilityBase} from '../database-models/candidate-availability-base'; 2 | //Generated Imports 3 | export class CandidateAvailability extends CandidateAvailabilityBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/candidate.ts: -------------------------------------------------------------------------------- 1 | import {CandidateBase} from '../database-models/candidate-base'; 2 | //Generated Imports 3 | export class Candidate extends CandidateBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/component-language-content.ts: -------------------------------------------------------------------------------- 1 | import {ComponentLanguageContentBase} from '../database-models/component-language-content-base'; 2 | import {LanguageContentKeyBase} from '../database-models/language-content-key-base'; 3 | import {LanguageContentBase} from '../database-models/language-content-base'; 4 | //Generated Imports 5 | export class ComponentLanguageContent extends ComponentLanguageContentBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region languageContentKey Prop 13 | languageContentKey : LanguageContentKeyBase; 14 | //#endregion languageContentKey Prop 15 | //#region languageContent Prop 16 | languageContent : LanguageContentBase; 17 | //#endregion languageContent Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/country.ts: -------------------------------------------------------------------------------- 1 | import {CountryBase} from '../database-models/country-base'; 2 | //Generated Imports 3 | export class Country extends CountryBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/language-content-key.ts: -------------------------------------------------------------------------------- 1 | import {LanguageContentKeyBase} from '../database-models/language-content-key-base'; 2 | import {LanguageContentBase} from '../database-models/language-content-base'; 3 | import {ComponentLanguageContentBase} from '../database-models/component-language-content-base'; 4 | //Generated Imports 5 | export class LanguageContentKey extends LanguageContentKeyBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region languageContents Prop 13 | languageContents : LanguageContentBase[]; 14 | //#endregion languageContents Prop 15 | //#region componentLanguageContents Prop 16 | componentLanguageContents : ComponentLanguageContentBase[]; 17 | //#endregion componentLanguageContents Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/language-content.ts: -------------------------------------------------------------------------------- 1 | import {LanguageContentBase} from '../database-models/language-content-base'; 2 | import {LanguageContentKeyBase} from '../database-models/language-content-key-base'; 3 | import {ComponentLanguageContentBase} from '../database-models/component-language-content-base'; 4 | //Generated Imports 5 | export class LanguageContent extends LanguageContentBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region languageContentKey Prop 13 | languageContentKey : LanguageContentKeyBase; 14 | //#endregion languageContentKey Prop 15 | //#region componentLanguageContents Prop 16 | componentLanguageContents : ComponentLanguageContentBase[]; 17 | //#endregion componentLanguageContents Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/module-master.ts: -------------------------------------------------------------------------------- 1 | import {ModuleMasterBase} from '../database-models/module-master-base'; 2 | import {ApplicationModuleBase} from '../database-models/application-module-base'; 3 | //Generated Imports 4 | export class ModuleMaster extends ModuleMasterBase 5 | { 6 | 7 | 8 | 9 | 10 | //#region Generated Reference Properties 11 | //#region applicationModules Prop 12 | applicationModules : ApplicationModuleBase[]; 13 | //#endregion applicationModules Prop 14 | 15 | //#endregion Generated Reference Properties 16 | 17 | 18 | 19 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/role-permission.ts: -------------------------------------------------------------------------------- 1 | import {RolePermissionBase} from '../database-models/role-permission-base'; 2 | import {ApplicationModuleBase} from '../database-models/application-module-base'; 3 | import {RoleBase} from '../database-models/role-base'; 4 | //Generated Imports 5 | export class RolePermission extends RolePermissionBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region applicationModule Prop 13 | applicationModule : ApplicationModuleBase; 14 | //#endregion applicationModule Prop 15 | //#region role Prop 16 | role : RoleBase; 17 | //#endregion role Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/role.ts: -------------------------------------------------------------------------------- 1 | import {RoleBase} from '../database-models/role-base'; 2 | import {UserRoleBase} from '../database-models/user-role-base'; 3 | import {RolePermissionBase} from '../database-models/role-permission-base'; 4 | //Generated Imports 5 | export class Role extends RoleBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region userRoles Prop 13 | userRoles : UserRoleBase[]; 14 | //#endregion userRoles Prop 15 | //#region rolePermissions Prop 16 | rolePermissions : RolePermissionBase[]; 17 | //#endregion rolePermissions Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/state.ts: -------------------------------------------------------------------------------- 1 | import {StateBase} from '../database-models/state-base'; 2 | //Generated Imports 3 | export class State extends StateBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/user-role.ts: -------------------------------------------------------------------------------- 1 | import {UserRoleBase} from '../database-models/user-role-base'; 2 | import {RoleBase} from '../database-models/role-base'; 3 | import {UserBase} from '../database-models/user-base'; 4 | //Generated Imports 5 | export class UserRole extends UserRoleBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region role Prop 13 | role : RoleBase; 14 | //#endregion role Prop 15 | //#region user Prop 16 | user : UserBase; 17 | //#endregion user Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/user.ts: -------------------------------------------------------------------------------- 1 | import {UserBase} from '../database-models/user-base'; 2 | import {ApplicationUserTokenBase} from '../database-models/application-user-token-base'; 3 | import {UserRoleBase} from '../database-models/user-role-base'; 4 | //Generated Imports 5 | export class User extends UserBase 6 | { 7 | 8 | 9 | 10 | 11 | //#region Generated Reference Properties 12 | //#region applicationUserTokens Prop 13 | applicationUserTokens : ApplicationUserTokenBase[]; 14 | //#endregion applicationUserTokens Prop 15 | //#region userRoles Prop 16 | userRoles : UserRoleBase[]; 17 | //#endregion userRoles Prop 18 | 19 | //#endregion Generated Reference Properties 20 | 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/v-candidate-record.ts: -------------------------------------------------------------------------------- 1 | import {vCandidateRecordBase} from '../database-models/v-candidate-record-base'; 2 | //Generated Imports 3 | export class vCandidateRecord extends vCandidateRecordBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/v-candidate.ts: -------------------------------------------------------------------------------- 1 | import {vCandidateBase} from '../database-models/v-candidate-base'; 2 | //Generated Imports 3 | export class vCandidate extends vCandidateBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/v-country-lookup.ts: -------------------------------------------------------------------------------- 1 | import {vCountryLookupBase} from '../database-models/v-country-lookup-base'; 2 | //Generated Imports 3 | export class vCountryLookup extends vCountryLookupBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/v-state-record.ts: -------------------------------------------------------------------------------- 1 | import {vStateRecordBase} from '../database-models/v-state-record-base'; 2 | //Generated Imports 3 | export class vStateRecord extends vStateRecordBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/models/extended-models/v-user.ts: -------------------------------------------------------------------------------- 1 | import {vUserBase} from '../database-models/v-user-base'; 2 | //Generated Imports 3 | export class vUser extends vUserBase 4 | { 5 | 6 | 7 | 8 | 9 | //#region Generated Reference Properties 10 | 11 | //#endregion Generated Reference Properties 12 | 13 | 14 | 15 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/HumanResourceApplication/src/app/uris/country-lookups.uri.ts: -------------------------------------------------------------------------------- 1 | export const COUNTRY_LOOKUPS :{ [key:string] : string } = { 2 | countryLookups : 'api/countrylookups/countrylookups'; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/Bootstrap/AddDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using ContosoApplication.BoundedContext.SqlContext; 3 | 4 | namespace ContosoApplication.Api.Bootstrap 5 | { 6 | public static class AddDbContextExtension 7 | { 8 | public static void AddDbContextService(this IServiceCollection serviceCollection) 9 | { 10 | #region SqlDbContext 11 | serviceCollection.AddDbContext(); 12 | serviceCollection.AddScoped(); 13 | serviceCollection.AddDbContext(); 14 | serviceCollection.AddScoped(); 15 | #endregion SqlDbContext 16 | 17 | 18 | 19 | } 20 | } 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/Bootstrap/ConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | using ContosoApplication.Models; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using RxWeb.Core.Data.Models; 5 | 6 | namespace ContosoApplication.Api.Bootstrap 7 | { 8 | public static class ConfigurationOptions 9 | { 10 | public static void AddConfigurationOptions(this IServiceCollection serviceCollection, IConfiguration configuration) 11 | { 12 | #region ConfigurationOptions 13 | serviceCollection.Configure(configuration.GetSection("Database")); 14 | serviceCollection.Configure(configuration.GetSection("Security")); 15 | #endregion ConfigurationOptions 16 | } 17 | } 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/Bootstrap/Singleton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using ContosoApplication.Infrastructure.Singleton; 3 | using ContosoApplication.BoundedContext.Singleton; 4 | using RxWeb.Core.Data; 5 | 6 | namespace ContosoApplication.Api.Bootstrap 7 | { 8 | public static class Singleton 9 | { 10 | public static void AddSingletonService(this IServiceCollection serviceCollection) 11 | { 12 | #region Singleton 13 | serviceCollection.AddSingleton(); 14 | serviceCollection.AddSingleton(typeof(UserAccessConfigInfo)); 15 | #endregion Singleton 16 | } 17 | 18 | } 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/Controllers/Api/MasterModule/CoursesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Linq; 3 | using ContosoApplication.UnitOfWork.Main; 4 | using ContosoApplication.Models.Main; 5 | using RxWeb.Core.AspNetCore; 6 | using RxWeb.Core.Security.Authorization; 7 | 8 | namespace ContosoApplication.Api.Controllers.MasterModule 9 | { 10 | [ApiController] 11 | [Route("api/[controller]")] 12 | 13 | public class CoursesController : BaseController 14 | 15 | { 16 | public CoursesController(IMasterUow uow):base(uow) {} 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/Controllers/Api/MasterModule/StudentsController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Linq; 3 | using ContosoApplication.UnitOfWork.Main; 4 | using ContosoApplication.Models.Main; 5 | using RxWeb.Core.AspNetCore; 6 | using RxWeb.Core.Security.Authorization; 7 | 8 | namespace ContosoApplication.Api.Controllers.MasterModule 9 | { 10 | [ApiController] 11 | [Route("api/[controller]")] 12 | 13 | public class StudentsController : BaseController 14 | 15 | { 16 | public StudentsController(IMasterUow uow):base(uow) {} 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace ContosoApplication.Api 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/appsettings.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "Database": { 5 | "MultiTenant": { 6 | "SchemaBasedMultiTenant": false, 7 | "TenantColumnName": "" 8 | }, 9 | "ConnectionString": { 10 | "Main": "data source= RXDBSERVER\\MSSQLSERVER2017;initial catalog=RxwebCoreDemoProjectDb;persist security info=True;User Id=RxArchitecture;Password=Rx@rchitecture; MultipleActiveResultSets=True;App=EntityFramework", 11 | "Log": "data source= RXDBSERVER\\MSSQLSERVER2017;initial catalog=RxwebCoreDemoProjectLogDb;persist security info=True;User Id=RxArchitecture;Password=Rx@rchitecture; MultipleActiveResultSets=True;App=EntityFramework" 12 | }, 13 | "CommandTimeout": 100, 14 | "ConnectionResiliency": { 15 | "MaxRetryCount": 2, 16 | "MaxRetryDelay": 20 17 | } 18 | }, 19 | "Security": { 20 | "AllowedHosts": [ "http://localhost:4200" ], 21 | "AllowedIps": [] 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Api/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.BoundedContext/ContosoApplication.BoundedContext.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | netcoreapp3.1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.BoundedContext/SqlDbContext/LogSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using ContosoApplication.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace ContosoApplication.BoundedContext.SqlContext 11 | { 12 | public class LogSqlDbContext : BaseDbContext, ILogDatabaseFacade, IDisposable 13 | { 14 | public LogSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Log")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.BoundedContext/SqlDbContext/MainSqlDbContext.cs: -------------------------------------------------------------------------------- 1 | using ContosoApplication.Models; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.Extensions.Options; 5 | using RxWeb.Core.Data; 6 | using RxWeb.Core.Data.BoundedContext; 7 | using RxWeb.Core.Data.Models; 8 | using System; 9 | 10 | namespace ContosoApplication.BoundedContext.SqlContext 11 | { 12 | public class MainSqlDbContext : BaseDbContext, IMainDatabaseFacade, IDisposable 13 | { 14 | public MainSqlDbContext(IOptions databaseConfig, IHttpContextAccessor contextAccessor, ITenantDbConnectionInfo tenantDbConnection) : base(databaseConfig, contextAccessor, tenantDbConnection) { } 15 | 16 | 17 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 18 | { 19 | optionsBuilder.UseSqlServer(this.GetConnection("Main")); 20 | 21 | base.OnConfiguring(optionsBuilder); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Domain/ContosoApplication.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | netcoreapp3.1 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Infrastructure/ContosoApplication.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | netcoreapp3.1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/ContosoApplication.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/DbEntities/Main/vCourseLookup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using RxWeb.Core.Annotations; 5 | using RxWeb.Core.Data.Annotations; 6 | using RxWeb.Core.Sanitizers; 7 | using ContosoApplication.BoundedContext.SqlContext; 8 | namespace ContosoApplication.Models.Main 9 | { 10 | [Table("vCourseLookups",Schema="dbo")] 11 | public partial class vCourseLookup 12 | { 13 | #region CourseId Annotations 14 | 15 | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 16 | [System.ComponentModel.DataAnnotations.Key] 17 | #endregion CourseId Annotations 18 | 19 | public int CourseId { get; set; } 20 | 21 | 22 | public string CourseName { get; set; } 23 | 24 | 25 | public vCourseLookup() 26 | { 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/DbEntities/Main/vStudent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using RxWeb.Core.Annotations; 5 | using RxWeb.Core.Data.Annotations; 6 | using RxWeb.Core.Sanitizers; 7 | using ContosoApplication.BoundedContext.SqlContext; 8 | namespace ContosoApplication.Models.Main 9 | { 10 | [Table("vStudents",Schema="dbo")] 11 | public partial class vStudent 12 | { 13 | #region RollNumber Annotations 14 | 15 | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 16 | [System.ComponentModel.DataAnnotations.Key] 17 | #endregion RollNumber Annotations 18 | 19 | public int RollNumber { get; set; } 20 | 21 | 22 | public string StudentName { get; set; } 23 | 24 | 25 | public string EmailId { get; set; } 26 | 27 | 28 | public string CourseName { get; set; } 29 | 30 | 31 | public vStudent() 32 | { 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/Enums/Main/Status.cs: -------------------------------------------------------------------------------- 1 | namespace ContosoApplication.Models.Enums.Main 2 | { 3 | public enum Status 4 | { 5 | Active = 1, 6 | InActive = 3, 7 | Deleted = 4, 8 | } 9 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/ExtendedModels/Main/Course.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ContosoApplication.Models.ExtendedModels.Main 6 | { 7 | public partial class Course 8 | { 9 | public void UniqueCourseName(object CourseName = null) { 10 | 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/Interface/ILogDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace ContosoApplication.BoundedContext.SqlContext 4 | { 5 | public interface ILogDatabaseFacade : IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/Interface/IMainDatabaseFacade.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Annotations; 2 | 3 | namespace ContosoApplication.BoundedContext.SqlContext 4 | { 5 | public interface IMainDatabaseFacade : IDatabaseFacade 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/Models/SecurityConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ContosoApplication.Models 4 | { 5 | public class SecurityConfig 6 | { 7 | public string[] AllowedHosts { get; set; } 8 | 9 | public string[] AllowedIps { get; set; } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/ViewModels/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace ContosoApplication.Models.ViewModels 4 | { 5 | 6 | public partial class AuthenticationModel 7 | { 8 | [Required] 9 | public string UserName { get; set; } 10 | 11 | [Required] 12 | public string Password { get; set; } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/ViewModels/StoreProcResult.cs: -------------------------------------------------------------------------------- 1 | namespace ContosoApplication.Models.ViewModels 2 | { 3 | public class StoreProcResult 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Result { get; set; } 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.Models/ViewModels/UserConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace ContosoApplication.Models.ViewModels 3 | { 4 | public class UserConfig 5 | { 6 | 7 | public string AudienceType { get; set; } 8 | 9 | public string LanguageCode { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.UnitOfWork/BaseUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | 3 | namespace ContosoApplication.UnitOfWork 4 | { 5 | public class BaseUow : CoreUnitOfWork 6 | { 7 | public BaseUow(IDbContext context, IRepositoryProvider repositoryProvider, IAuditLog auditLog = null) : base(context, repositoryProvider, auditLog) { } 8 | } 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.UnitOfWork/ContosoApplication.UnitOfWork.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | netcoreapp3.1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.UnitOfWork/Main/LoginUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using ContosoApplication.BoundedContext.Main; 3 | 4 | namespace ContosoApplication.UnitOfWork.Main 5 | { 6 | public class LoginUow : BaseUow, ILoginUow 7 | { 8 | public LoginUow(ILoginContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface ILoginUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/ContosoApplication.UnitOfWork/Main/MasterUow.cs: -------------------------------------------------------------------------------- 1 | using RxWeb.Core.Data; 2 | using ContosoApplication.BoundedContext.Main; 3 | 4 | namespace ContosoApplication.UnitOfWork.Main 5 | { 6 | public class MasterUow : BaseUow, IMasterUow 7 | { 8 | public MasterUow(IMasterContext context, IRepositoryProvider repositoryProvider) : base(context, repositoryProvider) { } 9 | } 10 | 11 | public interface IMasterUow : ICoreUnitOfWork { } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/rxweb-tool/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "api": "ContosoApplication.Api", 4 | "model": "ContosoApplication.Models", 5 | "context": "ContosoApplication.BoundedContext", 6 | "domain": "ContosoApplication.Domain", 7 | "unitOfWork": "ContosoApplication.UnitOfWork", 8 | "infrastructure": "ContosoApplication.Infrastructure", 9 | "azureFunctionHttp":"", 10 | "portal":"", 11 | "azureFunctionBackground":"" 12 | }, 13 | "path": { 14 | "dbConnection": { 15 | "main": "Database.ConnectionString.Main" 16 | }, 17 | "folder": { 18 | "model": "DbEntities", 19 | "context": "", 20 | "enums": "", 21 | "localizeValidationMessage": "wwwroot" 22 | } 23 | }, 24 | "annotations": { 25 | "rxweb": false 26 | }, 27 | "config": { 28 | "generateEnums": false, 29 | "commanTableSchema": "dbo", 30 | "validationMessageLocalizationId": "15" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Samples/AspNetCore/Documentation Examples/Tours of Contoso Application/Beginner/ContosoApplication/rxweb-tool/controllers.main.json: -------------------------------------------------------------------------------- 1 | {"Students":{"type":"","parent":null},"Courses":{"type":"","parent":null}} -------------------------------------------------------------------------------- /src/VsixProject/AspNetCoreVsix/ProjectTemplates/CleanArchitecture.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/VsixProject/AspNetCoreVsix/ProjectTemplates/CleanArchitecture.zip -------------------------------------------------------------------------------- /src/VsixProject/AspNetCoreVsix/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/VsixProject/AspNetCoreVsix/icon.png -------------------------------------------------------------------------------- /src/VsixProject/AspNetCoreVsix/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rxweb/RxWebCore/f3b564bf5d108384a15c721140137907751dd87e/src/VsixProject/AspNetCoreVsix/preview.png --------------------------------------------------------------------------------