├── .gitattributes ├── .gitignore ├── Business ├── Adapters │ ├── PersonService │ │ ├── IPersonService.cs │ │ └── PersonServiceManager.cs │ └── SmsService │ │ ├── ISmsService.cs │ │ └── SmsServiceManager.cs ├── Business.csproj ├── BusinessAspects │ └── SecuredOperation.cs ├── ConfigurationManager.cs ├── Connected Services │ └── wsKPSPublic │ │ ├── ConnectedService.json │ │ └── Reference.cs ├── Constants │ └── Messages.cs ├── DependencyResolvers │ └── AutofacBusinessModule.cs ├── Fakes │ ├── DArch │ │ └── DArchInMemory.cs │ └── IFakeStore.cs ├── Handlers │ ├── Authorizations │ │ ├── Commands │ │ │ ├── ForgotPasswordCommand.cs │ │ │ ├── LoginUserQuery.cs │ │ │ ├── RegisterUserCommand.cs │ │ │ ├── RegisterUserValidator.cs │ │ │ └── RuleBuilderExtensions.cs │ │ ├── Queries │ │ │ ├── LoginUserHandler.cs │ │ │ ├── VerifyCidQuery.cs │ │ │ └── VerifyOTPHandler.cs │ │ └── ValidationRules │ │ │ ├── LoginUserValidator.cs │ │ │ └── MobileLoginValidator.cs │ ├── GroupClaims │ │ ├── Commands │ │ │ ├── CreateGroupClaimCommand.cs │ │ │ ├── DeleteGroupClaimCommand.cs │ │ │ └── UpdateGroupClaimCommand.cs │ │ └── Queries │ │ │ ├── GetGroupClaimQuery.cs │ │ │ ├── GetGroupClaimsLookupByGroupIdQuery.cs │ │ │ └── GetGroupClaimsQuery.cs │ ├── Groups │ │ ├── Commands │ │ │ ├── CreateGroupCommand.cs │ │ │ ├── DeleteGroupCommand.cs │ │ │ └── UpdateGroupCommand.cs │ │ └── Queries │ │ │ ├── GetGroupLookupQuery.cs │ │ │ ├── GetGroupQuery.cs │ │ │ ├── GetGroupsQuery.cs │ │ │ └── SearchGroupsByNameQuery.cs │ ├── Languages │ │ ├── Commands │ │ │ ├── CreateLanguageCommand.cs │ │ │ ├── DeleteLanguageCommand.cs │ │ │ └── UpdateLanguageCommand.cs │ │ ├── Queries │ │ │ ├── GetLanguageQuery.cs │ │ │ ├── GetLanguagesLookUpQuery.cs │ │ │ ├── GetLanguagesLookUpWithCodeQuery.cs │ │ │ └── GetLanguagesQuery.cs │ │ └── ValidationRules │ │ │ └── LanguageValidator.cs │ ├── Logs │ │ └── Queries │ │ │ └── GetLogDtoQuery.cs │ ├── OperationClaims │ │ ├── Commands │ │ │ ├── CreateOperationClaimCommand.cs │ │ │ ├── DeleteOperationClaimCommand.cs │ │ │ └── UpdateOperationClaimCommand.cs │ │ └── Queries │ │ │ ├── GetOperationClaimLookupQuery.cs │ │ │ ├── GetOperationClaimQuery.cs │ │ │ └── GetOperationClaimsQuery.cs │ ├── Translates │ │ ├── Commands │ │ │ ├── CreateTranslateCommand.cs │ │ │ ├── DeleteTranslateCommand.cs │ │ │ └── UpdateTranslateCommand.cs │ │ ├── Queries │ │ │ ├── GetTranslateListDtoQuery.cs │ │ │ ├── GetTranslateQuery.cs │ │ │ ├── GetTranslateWordListQuery.cs │ │ │ ├── GetTranslatesByLangQuery.cs │ │ │ └── GetTranslatesQuery.cs │ │ └── ValidationRules │ │ │ └── TranslateValidator.cs │ ├── UserClaims │ │ ├── Commands │ │ │ ├── CreateUserClaimCommand.cs │ │ │ ├── CreateUserClaimsInternalCommand.cs │ │ │ ├── DeleteUserClaimCommand.cs │ │ │ └── UpdateUserClaimCommand.cs │ │ └── Queries │ │ │ ├── GetUserClaimLookupByUserIdQuery.cs │ │ │ ├── GetUserClaimLookupQuery.cs │ │ │ └── GetUserClaimsQuery.cs │ ├── UserGroups │ │ ├── Commands │ │ │ ├── CreateUserGroupClaimsCommand.cs │ │ │ ├── CreateUserGroupCommand.cs │ │ │ ├── DeleteUserGroupCommand.cs │ │ │ ├── UpdateUserGroupByGroupIdCommand.cs │ │ │ └── UpdateUserGroupCommand.cs │ │ └── Queries │ │ │ ├── GetUserGroupLookupByUserIdQuery.cs │ │ │ ├── GetUserGroupLookupQuery.cs │ │ │ ├── GetUserGroupQuery.cs │ │ │ ├── GetUserGroupsQuery.cs │ │ │ └── GetUsersInGroupLookupByGroupId.cs │ └── Users │ │ ├── Commands │ │ ├── CreateUserCommand.cs │ │ ├── DeleteUserCommand.cs │ │ ├── UpdateUserCommand.cs │ │ └── UserChangePasswordCommand.cs │ │ └── Queries │ │ ├── GetUserLookupQuery.cs │ │ ├── GetUserQuery.cs │ │ └── GetUsersQuery.cs ├── Helpers │ ├── AutoMapperHelper.cs │ ├── AwaitableLock.cs │ ├── EnumerableExtensions.cs │ ├── FakeDataMiddlleware.cs │ ├── OperationClaimCreatorMiddleware.cs │ └── ValidationExtensions.cs ├── Services │ └── Authentication │ │ ├── AgentAuthenticationProvider.cs │ │ ├── AuthenticationCoordinator.cs │ │ ├── AuthenticationProviderBase.cs │ │ ├── DArchToken.cs │ │ ├── IAuthenticationCoordinator.cs │ │ ├── IAuthenticationProvider.cs │ │ ├── ILoginDataProvider.cs │ │ ├── Model │ │ ├── LoginUserCommand.cs │ │ ├── LoginUserResult.cs │ │ └── VerifyOTPCommand.cs │ │ └── PersonAuthenticationProvider.cs └── Startup.cs ├── Core ├── ApiDoc │ ├── AddAuthHeaderOperationFilter.cs │ └── EnumSchemaFilter.cs ├── Aspects │ └── Autofac │ │ ├── Caching │ │ ├── CacheAspect.cs │ │ └── CacheRemoveAspect.cs │ │ ├── Exception │ │ └── ExceptionLogAspect.cs │ │ ├── Logging │ │ └── LogAspect.cs │ │ ├── Performance │ │ └── PerformanceAspect.cs │ │ ├── Transaction │ │ ├── TransactionScopeAspect.cs │ │ └── TransactionScopeAspectAsync.cs │ │ └── Validation │ │ └── ValidationAspect.cs ├── Core.csproj ├── CrossCuttingConcerns │ ├── Caching │ │ ├── ICacheManager.cs │ │ ├── Microsoft │ │ │ └── MemoryCacheManager.cs │ │ └── Redis │ │ │ └── RedisCacheManager.cs │ ├── Logging │ │ ├── LogDetail.cs │ │ ├── LogDetailWithException.cs │ │ ├── LogParameter.cs │ │ └── Serilog │ │ │ ├── ConfigurationModels │ │ │ ├── FileLogConfiguration.cs │ │ │ ├── LogstashConfiguration.cs │ │ │ ├── MSTeamsConfiguration.cs │ │ │ ├── MongoDbConfiguration.cs │ │ │ ├── MsSqlConfiguration.cs │ │ │ └── PostgreConfiguration.cs │ │ │ ├── LoggerServiceBase.cs │ │ │ └── Loggers │ │ │ ├── FileLogger.cs │ │ │ ├── LogstashLogger.cs │ │ │ ├── MSTeamsLogger.cs │ │ │ ├── MongoDbLogger.cs │ │ │ ├── MsSqlLogger.cs │ │ │ └── PostgreSqlLogger.cs │ └── Validation │ │ └── ValidationTool.cs ├── DataAccess │ ├── EntityFramework │ │ └── EfEntityRepositoryBase.cs │ ├── IDocumentDbRepository.cs │ ├── IEntityRepository.cs │ └── MongoDb │ │ └── Concrete │ │ ├── Configurations │ │ └── MongoConnectionSettings.cs │ │ └── MongoDbRepositoryBase.cs ├── DependencyResolvers │ └── CoreModule.cs ├── Entities │ ├── Concrete │ │ ├── AuthenticationProviderType.cs │ │ ├── Group.cs │ │ ├── GroupClaim.cs │ │ ├── Language.cs │ │ ├── Log.cs │ │ ├── MobileLogin.cs │ │ ├── OperationClaim.cs │ │ ├── Translate.cs │ │ ├── User.cs │ │ ├── UserClaim.cs │ │ ├── UserGroup.cs │ │ └── UserOperationClaim.cs │ ├── DocumentDbEntity.cs │ ├── Dtos │ │ ├── LogDto.cs │ │ ├── SelectionItem.cs │ │ ├── TranslateDto.cs │ │ └── UserDto.cs │ ├── IDto.cs │ └── IEntity.cs ├── Extensions │ ├── ClaimExtensions.cs │ ├── ClaimsPrincipalExtensions.cs │ ├── CloneServiceExtensions.cs │ ├── ContextExtensions.cs │ ├── DateTimeExtensions.cs │ ├── EnumExtensions.cs │ ├── ErrorDetails.cs │ ├── ExceptionMiddleware.cs │ ├── ExceptionMiddlewareExtensions.cs │ └── ServiceCollectionExtensions.cs └── Utilities │ ├── Business │ └── BusinessRules.cs │ ├── ElasticSearch │ ├── ElasticSearchManager.cs │ ├── IElasticSearch.cs │ └── Models │ │ ├── ElasticSearchConfig.cs │ │ ├── ElasticSearchGetModel.cs │ │ ├── ElasticSearchInsertManyModel.cs │ │ ├── ElasticSearchInsertUpdateModel.cs │ │ ├── ElasticSearchModel.cs │ │ ├── IndexModel.cs │ │ ├── SearchByFieldParameters.cs │ │ ├── SearchByQueryParameters.cs │ │ └── SearchParameters.cs │ ├── Interceptors │ ├── AspectInterceptorSelector.cs │ ├── MethodInterception.cs │ └── MethodInterceptionBaseAttribute.cs │ ├── IoC │ ├── ICoreModule.cs │ └── ServiceTool.cs │ ├── Mail │ ├── EmailAddress.cs │ ├── EmailConfiguration.cs │ ├── EmailMessage.cs │ ├── IEmailConfiguration.cs │ ├── IMailService.cs │ └── MailManager.cs │ ├── MessageBrokers │ └── RabbitMq │ │ ├── IMessageBrokerHelper.cs │ │ ├── IMessageConsumer.cs │ │ ├── MessageBrokerOptions.cs │ │ ├── MqConsumerHelper.cs │ │ └── MqQueueHelper.cs │ ├── Messages │ ├── AspectMessages.cs │ ├── DocumentDbMessages.cs │ ├── ExceptionMessage.cs │ ├── SerilogMessages.cs │ └── SwaggerMessages.cs │ ├── Results │ ├── ApiResult.cs │ ├── DataResult.cs │ ├── ErrorDataResult.cs │ ├── ErrorResult.cs │ ├── IDataResult.cs │ ├── IResult.cs │ ├── Result.cs │ ├── SuccessDataResult.cs │ └── SuccessResult.cs │ ├── Security │ ├── Encyption │ │ ├── SecurityKeyHelper.cs │ │ └── SigningCredentialsHelper.cs │ ├── Hashing │ │ └── HashingHelper.cs │ └── Jwt │ │ ├── AccessToken.cs │ │ ├── IAccessToken.cs │ │ ├── ITokenHelper.cs │ │ ├── JwtHelper.cs │ │ └── TokenOptions.cs │ └── Toolkit │ └── RandomPassword.cs ├── DataAccess ├── Abstract │ ├── IGroupClaimRepository.cs │ ├── IGroupRepository.cs │ ├── ILanguageRepository.cs │ ├── ILogRepository.cs │ ├── IMobileLoginRepository.cs │ ├── IOperationClaimRepository.cs │ ├── ITranslateRepository.cs │ ├── IUserClaimRepository.cs │ ├── IUserGroupRepository.cs │ └── IUserRepository.cs ├── Concrete │ ├── Configurations │ │ ├── GroupClaimEntityConfiguration.cs │ │ ├── GroupEntityConfiguration.cs │ │ ├── LanguageEntityConfiguration.cs │ │ ├── MobileLoginEntityConfiguration.cs │ │ ├── OperationClaimEntityConfiguration.cs │ │ ├── TranslateEntityConfiguration.cs │ │ ├── UserClaimEntityConfiguration.cs │ │ ├── UserEntityConfiguration.cs │ │ └── UserGroupEntityConfiguration.cs │ ├── EntityFramework │ │ ├── ContextExtensions.cs │ │ ├── Contexts │ │ │ ├── MsDbContext.cs │ │ │ └── ProjectDbContext.cs │ │ ├── GroupClaimRepository.cs │ │ ├── GroupRepository.cs │ │ ├── LanguageRepository.cs │ │ ├── LogRepository.cs │ │ ├── MobileLoginRepository.cs │ │ ├── OperationClaimRepository.cs │ │ ├── TranslateRepository.cs │ │ ├── UserClaimRepository.cs │ │ ├── UserGroupRepository.cs │ │ └── UserRepository.cs │ └── MongoDb │ │ ├── Collections │ │ └── Collections.cs │ │ └── Context │ │ ├── MongoDbContext.cs │ │ └── MongoDbContextBase.cs ├── DataAccess.csproj └── Migrations │ └── HowTo.md ├── DevArchitecture.sln ├── Entities ├── Concrete │ ├── DocumentDbEntityExample.cs │ └── EntityExample.cs ├── Dtos │ └── Citizen.cs └── Entities.csproj ├── Tests ├── Api │ └── UserContollerTest.cs ├── Business │ ├── Adapters │ │ ├── PersonManagerTest.cs │ │ ├── PersonServiceHelper.cs │ │ ├── SmsServiceHelper.cs │ │ └── SmsServiceTest.cs │ └── HandlersTest │ │ ├── AuthorizationsTests.cs │ │ ├── LanguageHandlerTests.cs │ │ ├── LogHandlerTests.cs │ │ ├── TranslateHandlerTests.cs │ │ └── UserGroupsTests.cs ├── Core │ └── Extensions │ │ ├── ClaimExtensionTests.cs │ │ ├── CloneExtesionServiceTest.cs │ │ └── EnumExtensionTests.cs ├── Helpers │ ├── ClaimsData.cs │ ├── DataHelper.cs │ └── TokenHelpers │ │ ├── BaseIntegrationTest.cs │ │ └── MockJwtTokens.cs ├── MockInterfaces │ └── IDbSets.cs ├── Services │ └── Authentication │ │ ├── AuthenticationProviderTest.cs │ │ └── TokenTest.cs └── Tests.csproj ├── UiPreparation ├── Program.cs ├── UI │ ├── .gitignore │ ├── angular.json │ ├── e2e │ │ └── app.po.ts │ ├── karma.conf.js │ ├── package-lock.json │ ├── package.json │ ├── protractor.conf.js │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── app.routing.ts │ │ │ └── core │ │ │ │ ├── components │ │ │ │ ├── admin │ │ │ │ │ ├── group │ │ │ │ │ │ ├── Models │ │ │ │ │ │ │ └── Group.ts │ │ │ │ │ │ ├── Services │ │ │ │ │ │ │ ├── Group.service.spec.ts │ │ │ │ │ │ │ └── Group.service.ts │ │ │ │ │ │ ├── group.component.html │ │ │ │ │ │ ├── group.component.scss │ │ │ │ │ │ ├── group.component.spec.ts │ │ │ │ │ │ └── group.component.ts │ │ │ │ │ ├── language │ │ │ │ │ │ ├── language.component.html │ │ │ │ │ │ ├── language.component.scss │ │ │ │ │ │ ├── language.component.ts │ │ │ │ │ │ ├── models │ │ │ │ │ │ │ └── language.ts │ │ │ │ │ │ └── services │ │ │ │ │ │ │ └── language.service.ts │ │ │ │ │ ├── log │ │ │ │ │ │ ├── logDto.component.scss │ │ │ │ │ │ ├── logDto.component.ts │ │ │ │ │ │ ├── logdto.component.html │ │ │ │ │ │ ├── models │ │ │ │ │ │ │ └── logdto.ts │ │ │ │ │ │ └── services │ │ │ │ │ │ │ └── logdto.service.ts │ │ │ │ │ ├── login │ │ │ │ │ │ ├── Services │ │ │ │ │ │ │ ├── Auth.service.spec.ts │ │ │ │ │ │ │ └── Auth.service.ts │ │ │ │ │ │ ├── login.component.html │ │ │ │ │ │ ├── login.component.scss │ │ │ │ │ │ ├── login.component.spec.ts │ │ │ │ │ │ ├── login.component.ts │ │ │ │ │ │ ├── login.css │ │ │ │ │ │ └── model │ │ │ │ │ │ │ ├── login-user.ts │ │ │ │ │ │ │ └── token-model.ts │ │ │ │ │ ├── operationclaim │ │ │ │ │ │ ├── models │ │ │ │ │ │ │ └── operationclaim.ts │ │ │ │ │ │ ├── operationClaim.component.scss │ │ │ │ │ │ ├── operationClaim.component.ts │ │ │ │ │ │ ├── operationclaim.component.html │ │ │ │ │ │ └── services │ │ │ │ │ │ │ └── operationclaim.service.ts │ │ │ │ │ ├── translate │ │ │ │ │ │ ├── models │ │ │ │ │ │ │ ├── translate.ts │ │ │ │ │ │ │ └── translateDto.ts │ │ │ │ │ │ ├── services │ │ │ │ │ │ │ └── translate.service.ts │ │ │ │ │ │ ├── translate.component.html │ │ │ │ │ │ ├── translate.component.scss │ │ │ │ │ │ └── translate.component.ts │ │ │ │ │ └── user │ │ │ │ │ │ ├── Services │ │ │ │ │ │ ├── User.service.spec.ts │ │ │ │ │ │ └── User.service.ts │ │ │ │ │ │ ├── models │ │ │ │ │ │ ├── User.ts │ │ │ │ │ │ └── passwordDto.ts │ │ │ │ │ │ ├── user.component.html │ │ │ │ │ │ ├── user.component.scss │ │ │ │ │ │ ├── user.component.spec.ts │ │ │ │ │ │ └── user.component.ts │ │ │ │ └── app │ │ │ │ │ ├── dashboard │ │ │ │ │ ├── dashboard.component.css │ │ │ │ │ ├── dashboard.component.html │ │ │ │ │ ├── dashboard.component.spec.ts │ │ │ │ │ └── dashboard.component.ts │ │ │ │ │ ├── footer │ │ │ │ │ ├── footer.component.css │ │ │ │ │ ├── footer.component.html │ │ │ │ │ ├── footer.component.spec.ts │ │ │ │ │ └── footer.component.ts │ │ │ │ │ ├── layouts │ │ │ │ │ └── admin-layout │ │ │ │ │ │ ├── admin-layout.component.html │ │ │ │ │ │ ├── admin-layout.component.scss │ │ │ │ │ │ ├── admin-layout.component.spec.ts │ │ │ │ │ │ ├── admin-layout.component.ts │ │ │ │ │ │ └── admin-layout.routing.ts │ │ │ │ │ ├── navbar │ │ │ │ │ ├── navbar.component.css │ │ │ │ │ ├── navbar.component.html │ │ │ │ │ ├── navbar.component.spec.ts │ │ │ │ │ └── navbar.component.ts │ │ │ │ │ └── sidebar │ │ │ │ │ ├── sidebar.component.css │ │ │ │ │ ├── sidebar.component.html │ │ │ │ │ ├── sidebar.component.spec.ts │ │ │ │ │ └── sidebar.component.ts │ │ │ │ ├── directives │ │ │ │ └── must-match.ts │ │ │ │ ├── guards │ │ │ │ └── login-guard.ts │ │ │ │ ├── interceptors │ │ │ │ ├── auth-interceptor.service.spec.ts │ │ │ │ └── auth-interceptor.service.ts │ │ │ │ ├── models │ │ │ │ └── LookUp.ts │ │ │ │ ├── modules │ │ │ │ ├── admin-layout.module.ts │ │ │ │ └── components.module.ts │ │ │ │ └── services │ │ │ │ ├── Alertify.service.spec.ts │ │ │ │ ├── Alertify.service.ts │ │ │ │ ├── LookUp.service.spec.ts │ │ │ │ ├── LookUp.service.ts │ │ │ │ ├── Translation.service.spec.ts │ │ │ │ ├── Translation.service.ts │ │ │ │ ├── local-storage.service.spec.ts │ │ │ │ └── local-storage.service.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── css │ │ │ │ └── demo.css │ │ │ ├── i18n │ │ │ │ ├── en-US.json │ │ │ │ └── tr-TR.json │ │ │ ├── img │ │ │ │ ├── angular.png │ │ │ │ ├── angular2-logo-red.png │ │ │ │ ├── angular2-logo.png │ │ │ │ ├── apple-icon.png │ │ │ │ ├── cover.jpeg │ │ │ │ ├── faces │ │ │ │ │ └── marc.jpg │ │ │ │ ├── favicon.png │ │ │ │ ├── gears.gif │ │ │ │ ├── html.png │ │ │ │ ├── logo │ │ │ │ │ ├── logo.png │ │ │ │ │ ├── logoşşş.png │ │ │ │ │ ├── photo_2020-12-18_21-41-29.jpg │ │ │ │ │ ├── photo_2020-12-18_21-41-29.png │ │ │ │ │ └── xxxxlogox.png │ │ │ │ ├── mask.png │ │ │ │ ├── new_logo.png │ │ │ │ ├── sidebar-1.jpg │ │ │ │ ├── sidebar-2.jpg │ │ │ │ ├── sidebar-3.jpg │ │ │ │ ├── sidebar-4.jpg │ │ │ │ └── tim_80x80.png │ │ │ └── scss │ │ │ │ ├── core │ │ │ │ ├── _alerts.scss │ │ │ │ ├── _angular-modal.scss │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _cards.scss │ │ │ │ ├── _checkboxes.scss │ │ │ │ ├── _dropdown.scss │ │ │ │ ├── _example-pages.scss │ │ │ │ ├── _fixed-plugin.scss │ │ │ │ ├── _footers.scss │ │ │ │ ├── _forms.scss │ │ │ │ ├── _images.scss │ │ │ │ ├── _input-group.scss │ │ │ │ ├── _misc.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _navbar.scss │ │ │ │ ├── _popover.scss │ │ │ │ ├── _popups.scss │ │ │ │ ├── _radios.scss │ │ │ │ ├── _responsive.scss │ │ │ │ ├── _ripples.scss │ │ │ │ ├── _sidebar-and-main-panel.scss │ │ │ │ ├── _tables.scss │ │ │ │ ├── _tabs.scss │ │ │ │ ├── _togglebutton.scss │ │ │ │ ├── _tooltip.scss │ │ │ │ ├── _type.scss │ │ │ │ ├── _variables.scss │ │ │ │ ├── cards │ │ │ │ │ ├── _card-plain.scss │ │ │ │ │ ├── _card-profile.scss │ │ │ │ │ └── _card-stats.scss │ │ │ │ ├── mixins │ │ │ │ │ ├── _alert.scss │ │ │ │ │ ├── _animations.scss │ │ │ │ │ ├── _breakpoints.scss │ │ │ │ │ ├── _buttons.scss │ │ │ │ │ ├── _chartist.scss │ │ │ │ │ ├── _colored-shadows.scss │ │ │ │ │ ├── _drawer.scss │ │ │ │ │ ├── _forms.scss │ │ │ │ │ ├── _hover.scss │ │ │ │ │ ├── _layout.scss │ │ │ │ │ ├── _navbar-colors.scss │ │ │ │ │ ├── _navs.scss │ │ │ │ │ ├── _sidebar-color.scss │ │ │ │ │ ├── _transparency.scss │ │ │ │ │ ├── _type.scss │ │ │ │ │ ├── _utilities.scss │ │ │ │ │ ├── _variables.scss │ │ │ │ │ └── _vendor-prefixes.scss │ │ │ │ ├── plugins │ │ │ │ │ ├── _animate.scss │ │ │ │ │ ├── _chartist.scss │ │ │ │ │ └── _perfect-scrollbar.scss │ │ │ │ └── variables │ │ │ │ │ ├── _body.scss │ │ │ │ │ ├── _bootstrap-material-design-base.scss │ │ │ │ │ ├── _bootstrap-material-design.scss │ │ │ │ │ ├── _brand.scss │ │ │ │ │ ├── _buttons.scss │ │ │ │ │ ├── _card.scss │ │ │ │ │ ├── _code.scss │ │ │ │ │ ├── _colors-map.scss │ │ │ │ │ ├── _colors.scss │ │ │ │ │ ├── _custom-forms.scss │ │ │ │ │ ├── _drawer.scss │ │ │ │ │ ├── _dropdown.scss │ │ │ │ │ ├── _forms.scss │ │ │ │ │ ├── _layout.scss │ │ │ │ │ ├── _list-group.scss │ │ │ │ │ ├── _menu.scss │ │ │ │ │ ├── _modals.scss │ │ │ │ │ ├── _nav.scss │ │ │ │ │ ├── _pagination.scss │ │ │ │ │ ├── _shadow.scss │ │ │ │ │ ├── _snackbar.scss │ │ │ │ │ ├── _spacing.scss │ │ │ │ │ ├── _state.scss │ │ │ │ │ ├── _tables.scss │ │ │ │ │ ├── _tooltip.scss │ │ │ │ │ └── _type.scss │ │ │ │ └── material-dashboard.scss │ │ ├── environments │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── typings.d.ts │ ├── tsconfig.json │ └── tslint.json └── UiPreparation.csproj └── WebAPI ├── Controllers ├── AuthController.cs ├── BaseApiController.cs ├── GroupClaimsController.cs ├── GroupsController.cs ├── LanguagesController.cs ├── LogsController.cs ├── OperationClaimsController.cs ├── TranslatesController.cs ├── UserClaimsController.cs ├── UserGroupsController.cs └── UsersController.cs ├── EntityBaseOverride ├── OverrideBase.cs └── ServiceInjection.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Startup.cs ├── SwaggerMessages.cs ├── WebAPI.csproj ├── appsettings.Development.json ├── appsettings.Production.json ├── appsettings.Staging.json ├── appsettings.json └── web.config /Business/Adapters/PersonService/IPersonService.cs: -------------------------------------------------------------------------------- 1 | using Entities.Dtos; 2 | using System.Threading.Tasks; 3 | 4 | namespace Business.Adapters.PersonService 5 | { 6 | public interface IPersonService 7 | { 8 | Task VerifyCid(Citizen citizen); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Business/Adapters/PersonService/PersonServiceManager.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Threading.Tasks; 3 | using wsKPSPublic; 4 | using Entities.Dtos; 5 | 6 | namespace Business.Adapters.PersonService 7 | { 8 | public class PersonServiceManager : IPersonService 9 | { 10 | public async Task VerifyCid(Citizen citizen) 11 | { 12 | return await Verify(citizen); 13 | } 14 | 15 | private static async Task Verify(Citizen citizen) 16 | { 17 | var locale = new CultureInfo("tr-TR", false); 18 | var svc = new KPSPublicSoapClient(KPSPublicSoapClient.EndpointConfiguration.KPSPublicSoap); 19 | { 20 | var cmd = await svc.TCKimlikNoDogrulaAsync( 21 | citizen.CitizenId, 22 | citizen.Name.ToUpper(locale), 23 | citizen.Surname.ToUpper(locale), 24 | citizen.BirthYear); 25 | return cmd.Body.TCKimlikNoDogrulaResult; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Business/Adapters/SmsService/ISmsService.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Business.Adapters.SmsService 4 | { 5 | public interface ISmsService 6 | { 7 | Task Send(string password, string text, string cellPhone); 8 | Task SendAsist(string text, string cellPhone); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Business/Adapters/SmsService/SmsServiceManager.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | 4 | namespace Business.Adapters.SmsService 5 | { 6 | public class SmsServiceManager : ISmsService 7 | { 8 | public async Task Send(string password, string text, string cellPhone) 9 | { 10 | Thread.Sleep(1000); 11 | return await Task.FromResult(true); 12 | } 13 | public async Task SendAsist(string text, string cellPhone) 14 | { 15 | Thread.Sleep(1000); 16 | return await Task.FromResult(true); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Business/BusinessAspects/SecuredOperation.cs: -------------------------------------------------------------------------------- 1 | using Business.Constants; 2 | using Castle.DynamicProxy; 3 | using Core.Extensions; 4 | using Core.Utilities.Interceptors; 5 | using Core.Utilities.IoC; 6 | using Microsoft.AspNetCore.Http; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using System.Security; 9 | 10 | namespace Business.BusinessAspects 11 | { 12 | /// 13 | ///This Aspect control the user's roles in HttpContext by inject the IHttpContextAccessor. 14 | ///It is checked by writing as [SecuredOperation] on the handler. 15 | ///If a valid authorization cannot be found in aspec, it throws an exception. 16 | /// 17 | 18 | public class SecuredOperation : MethodInterception 19 | { 20 | private readonly IHttpContextAccessor _httpContextAccessor; 21 | 22 | public SecuredOperation() 23 | { 24 | _httpContextAccessor = ServiceTool.ServiceProvider.GetService(); 25 | } 26 | 27 | protected override void OnBefore(IInvocation invocation) 28 | { 29 | var roleClaims = _httpContextAccessor.HttpContext.User.ClaimRoles(); 30 | var operationName = invocation.TargetType.ReflectedType.Name; 31 | if (roleClaims.Contains(operationName)) 32 | return; 33 | 34 | throw new SecurityException(Messages.AuthorizationsDenied); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Business/ConfigurationManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.Hosting; 3 | using System; 4 | 5 | namespace Business 6 | { 7 | public class ConfigurationManager 8 | { 9 | public ApplicationMode Mode { get; private set; } 10 | 11 | public ConfigurationManager(IConfiguration configuration, IHostEnvironment env) 12 | { 13 | 14 | Mode = (ApplicationMode)Enum.Parse(typeof(ApplicationMode), env.EnvironmentName); 15 | } 16 | } 17 | 18 | public enum ApplicationMode 19 | { 20 | Development, 21 | Profiling, 22 | Staging, 23 | Production, 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Business/Fakes/DArch/DArchInMemory.cs: -------------------------------------------------------------------------------- 1 | using DataAccess.Concrete.EntityFramework.Contexts; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace Business.Fakes.DArch 7 | { 8 | public sealed class DArchInMemory : ProjectDbContext 9 | { 10 | public DArchInMemory(DbContextOptions options, IConfiguration configuration) : base(options, configuration) 11 | { 12 | } 13 | 14 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 15 | { 16 | if (!optionsBuilder.IsConfigured) 17 | { 18 | base.OnConfiguring(optionsBuilder.UseInMemoryDatabase(configuration.GetConnectionString("DArchInMemory"))); 19 | 20 | } 21 | } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Business/Fakes/IFakeStore.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Business.Fakes 4 | { 5 | public interface IFakeStore 6 | { 7 | List Set(); 8 | } 9 | } -------------------------------------------------------------------------------- /Business/Handlers/Authorizations/Commands/RegisterUserValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | 3 | namespace Business.Handlers.Authorizations.Commands 4 | { 5 | 6 | public class RegisterUserValidator : AbstractValidator 7 | { 8 | public RegisterUserValidator() 9 | { 10 | RuleFor(p => p.Password).Password(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Business/Handlers/Authorizations/Commands/RuleBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Business.Constants; 2 | using FluentValidation; 3 | 4 | namespace Business.Handlers.Authorizations.Commands 5 | { 6 | public static class RuleBuilderExtensions 7 | { 8 | public static IRuleBuilder Password(this IRuleBuilder ruleBuilder, int minimumLength = 8) 9 | { 10 | var options = ruleBuilder 11 | .NotEmpty().WithMessage(Messages.PasswordEmpty) 12 | .MinimumLength(minimumLength).WithMessage(Messages.PasswordLength) 13 | .Matches("[A-Z]").WithMessage(Messages.PasswordUppercaseLetter) 14 | .Matches("[a-z]").WithMessage(Messages.PasswordLowercaseLetter) 15 | .Matches("[0-9]").WithMessage(Messages.PasswordDigit) 16 | .Matches("[^a-zA-Z0-9]").WithMessage(Messages.PasswordSpecialCharacter); 17 | return options; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Business/Handlers/Authorizations/ValidationRules/LoginUserValidator.cs: -------------------------------------------------------------------------------- 1 | using Business.Helpers; 2 | using Business.Services.Authentication.Model; 3 | using Core.Entities; 4 | using FluentValidation; 5 | using Business.Constants; 6 | 7 | namespace Business.Handlers.Authorizations 8 | { 9 | 10 | public class LoginUserValidator : AbstractValidator 11 | { 12 | public LoginUserValidator() 13 | { 14 | RuleFor(m => m.Password).NotEmpty() 15 | .When((i) => i.Provider != AuthenticationProviderType.Person); 16 | RuleFor(m => m.ExternalUserId).NotEmpty().Must((instance, value) => 17 | { 18 | switch (instance.Provider) 19 | { 20 | case AuthenticationProviderType.Person: 21 | return value.IsCidValid(); 22 | case AuthenticationProviderType.Staff: 23 | return true; 24 | case AuthenticationProviderType.Agent: 25 | break; 26 | default: 27 | break; 28 | } 29 | return false; 30 | }) 31 | .WithMessage(Messages.InvalidCode) 32 | .OverridePropertyName(Messages.CID); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Business/Handlers/Authorizations/ValidationRules/MobileLoginValidator.cs: -------------------------------------------------------------------------------- 1 | using Business.Constants; 2 | using Business.Services.Authentication.Model; 3 | using Core.Entities; 4 | using FluentValidation; 5 | 6 | namespace Business.Handlers.Authorizations 7 | { 8 | public class MobileLoginValidator : AbstractValidator 9 | { 10 | public MobileLoginValidator() 11 | { 12 | RuleFor(p => p.ExternalUserId).NotEmpty(); 13 | RuleFor(m => m.Code).Must((instance, value) => 14 | { 15 | switch (instance.Provider) 16 | { 17 | case AuthenticationProviderType.Person: 18 | return value > 0; 19 | case AuthenticationProviderType.Staff: 20 | return value > 0; 21 | case AuthenticationProviderType.Agent: 22 | return value == 0; 23 | default: 24 | break; 25 | } 26 | return false; 27 | }) 28 | .WithMessage(Messages.InvalidCode); 29 | } 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /Business/Handlers/GroupClaims/Queries/GetGroupClaimQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Business.Handlers.GroupClaims.Queries 10 | { 11 | [SecuredOperation] 12 | public class GetGroupClaimQuery : IRequest> 13 | { 14 | public int Id { get; set; } 15 | 16 | public class GetGroupClaimQueryHandler : IRequestHandler> 17 | { 18 | private readonly IGroupClaimRepository _groupClaimRepository; 19 | 20 | public GetGroupClaimQueryHandler(IGroupClaimRepository groupClaimRepository) 21 | { 22 | _groupClaimRepository = groupClaimRepository; 23 | } 24 | 25 | public async Task> Handle(GetGroupClaimQuery request, CancellationToken cancellationToken) 26 | { 27 | return new SuccessDataResult(await _groupClaimRepository.GetAsync(x => x.GroupId == request.Id)); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Business/Handlers/GroupClaims/Queries/GetGroupClaimsLookupByGroupIdQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Utilities.Results; 3 | using DataAccess.Abstract; 4 | using Core.Entities.Dtos; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.GroupClaims.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetGroupClaimsLookupByGroupIdQuery : IRequest>> 14 | { 15 | public int GroupId { get; set; } 16 | public class GetGroupClaimsLookupByGroupIdQueryHandler : IRequestHandler>> 17 | { 18 | private readonly IGroupClaimRepository _groupClaimRepository; 19 | 20 | public GetGroupClaimsLookupByGroupIdQueryHandler(IGroupClaimRepository groupClaimRepository) 21 | { 22 | _groupClaimRepository = groupClaimRepository; 23 | } 24 | 25 | public async Task>> Handle(GetGroupClaimsLookupByGroupIdQuery request, CancellationToken cancellationToken) 26 | { 27 | var data = await _groupClaimRepository.GetGroupClaimsSelectedList(request.GroupId); 28 | return new SuccessDataResult>(data); 29 | 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Business/Handlers/GroupClaims/Queries/GetGroupClaimsQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.GroupClaims.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetGroupClaimsQuery : IRequest>> 14 | { 15 | 16 | public class GetGroupClaimsQueryHandler : IRequestHandler>> 17 | { 18 | private readonly IGroupClaimRepository _groupClaimRepository; 19 | 20 | public GetGroupClaimsQueryHandler(IGroupClaimRepository groupClaimRepository) 21 | { 22 | _groupClaimRepository = groupClaimRepository; 23 | } 24 | 25 | public async Task>> Handle(GetGroupClaimsQuery request, CancellationToken cancellationToken) 26 | { 27 | return new SuccessDataResult>(await _groupClaimRepository.GetListAsync()); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Business/Handlers/Groups/Commands/DeleteGroupCommand.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Business.Constants; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Business.Handlers.Groups.Commands 10 | { 11 | [SecuredOperation] 12 | public class DeleteGroupCommand : IRequest 13 | { 14 | public int Id { get; set; } 15 | public class DeleteGroupCommandHandler : IRequestHandler 16 | { 17 | private readonly IGroupRepository _groupRepository; 18 | 19 | public DeleteGroupCommandHandler(IGroupRepository groupRepository) 20 | { 21 | _groupRepository = groupRepository; 22 | } 23 | 24 | public async Task Handle(DeleteGroupCommand request, CancellationToken cancellationToken) 25 | { 26 | var groupToDelete = await _groupRepository.GetAsync(x => x.Id == request.Id); 27 | 28 | _groupRepository.Delete(groupToDelete); 29 | await _groupRepository.SaveChangesAsync(); 30 | 31 | return new SuccessResult(Messages.Deleted); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Business/Handlers/Groups/Queries/GetGroupLookupQuery.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results; 2 | using DataAccess.Abstract; 3 | using Core.Entities.Dtos; 4 | using MediatR; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.Groups.Queries 11 | { 12 | public class GetGroupLookupQuery : IRequest>> 13 | { 14 | public class GetGroupSelectListQueryHandler : IRequestHandler>> 15 | { 16 | private readonly IGroupRepository _groupRepository; 17 | public GetGroupSelectListQueryHandler(IGroupRepository groupRepository) 18 | { 19 | _groupRepository = groupRepository; 20 | } 21 | public async Task>> Handle(GetGroupLookupQuery request, CancellationToken cancellationToken) 22 | { 23 | var list = await _groupRepository.GetListAsync(); 24 | var groupList = list.Select(x => new SelectionItem() 25 | { 26 | Id = x.Id.ToString(), 27 | Label = x.GroupName 28 | }); 29 | return new SuccessDataResult>(groupList); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Business/Handlers/Groups/Queries/GetGroupQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Business.Handlers.Groups.Queries 10 | { 11 | [SecuredOperation] 12 | public class GetGroupQuery : IRequest> 13 | { 14 | public int GroupId { get; set; } 15 | 16 | public class GetGroupQueryHandler : IRequestHandler> 17 | { 18 | private readonly IGroupRepository _groupRepository; 19 | 20 | public GetGroupQueryHandler(IGroupRepository groupRepository) 21 | { 22 | _groupRepository = groupRepository; 23 | } 24 | 25 | public async Task> Handle(GetGroupQuery request, CancellationToken cancellationToken) 26 | { 27 | var group = await _groupRepository.GetAsync(x => x.Id == request.GroupId); 28 | 29 | return new SuccessDataResult(group); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Business/Handlers/Groups/Queries/GetGroupsQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | 11 | namespace Business.Handlers.Groups.Queries 12 | { 13 | [SecuredOperation] 14 | public class GetGroupsQuery : IRequest>> 15 | { 16 | 17 | public class GetGroupsQueryHandler : IRequestHandler>> 18 | { 19 | private readonly IGroupRepository _groupRepository; 20 | public GetGroupsQueryHandler(IGroupRepository groupRepository) 21 | { 22 | _groupRepository = groupRepository; 23 | } 24 | public async Task>> Handle(GetGroupsQuery request, CancellationToken cancellationToken) 25 | { 26 | var list = await _groupRepository.GetListAsync(); 27 | return new SuccessDataResult>(list.ToList()); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Business/Handlers/Languages/ValidationRules/LanguageValidator.cs: -------------------------------------------------------------------------------- 1 |  2 | using Business.Handlers.Languages.Commands; 3 | using FluentValidation; 4 | 5 | namespace Business.Handlers.Languages.ValidationRules 6 | { 7 | public class CreateLanguageValidator : AbstractValidator 8 | { 9 | public CreateLanguageValidator() 10 | { 11 | RuleFor(x => x.Name).NotEmpty(); 12 | RuleFor(x => x.Code).NotEmpty(); 13 | } 14 | } 15 | public class UpdateLanguageValidator : AbstractValidator 16 | { 17 | public UpdateLanguageValidator() 18 | { 19 | RuleFor(x => x.Name).NotEmpty(); 20 | RuleFor(x => x.Code).NotEmpty(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Business/Handlers/OperationClaims/Queries/GetOperationClaimQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Business.Handlers.OperationClaims.Queries 10 | { 11 | [SecuredOperation] 12 | public class GetOperationClaimQuery : IRequest> 13 | { 14 | public int Id { get; set; } 15 | public class GetOperationClaimQueryHandler : IRequestHandler> 16 | { 17 | private readonly IOperationClaimRepository _operationClaimRepository; 18 | 19 | public GetOperationClaimQueryHandler(IOperationClaimRepository operationClaimRepository) 20 | { 21 | _operationClaimRepository = operationClaimRepository; 22 | } 23 | 24 | public async Task> Handle(GetOperationClaimQuery request, CancellationToken cancellationToken) 25 | { 26 | return new SuccessDataResult(await _operationClaimRepository.GetAsync(x => x.Id == request.Id)); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Business/Handlers/OperationClaims/Queries/GetOperationClaimsQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.OperationClaims.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetOperationClaimsQuery : IRequest>> 14 | { 15 | public class GetOperationClaimsQueryHandler : IRequestHandler>> 16 | { 17 | private readonly IOperationClaimRepository _operationClaimRepository; 18 | 19 | public GetOperationClaimsQueryHandler(IOperationClaimRepository operationClaimRepository) 20 | { 21 | _operationClaimRepository = operationClaimRepository; 22 | } 23 | 24 | public async Task>> Handle(GetOperationClaimsQuery request, CancellationToken cancellationToken) 25 | { 26 | return new SuccessDataResult>(await _operationClaimRepository.GetListAsync()); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Business/Handlers/Translates/ValidationRules/TranslateValidator.cs: -------------------------------------------------------------------------------- 1 |  2 | using Business.Handlers.Translates.Commands; 3 | using FluentValidation; 4 | 5 | namespace Business.Handlers.Translates.ValidationRules 6 | { 7 | public class CreateTranslateValidator : AbstractValidator 8 | { 9 | public CreateTranslateValidator() 10 | { 11 | RuleFor(x => x.LangId).NotEmpty(); 12 | RuleFor(x => x.Value).NotEmpty(); 13 | RuleFor(x => x.Code).NotEmpty(); 14 | 15 | } 16 | } 17 | public class UpdateTranslateValidator : AbstractValidator 18 | { 19 | public UpdateTranslateValidator() 20 | { 21 | RuleFor(x => x.LangId).NotEmpty(); 22 | RuleFor(x => x.Value).NotEmpty(); 23 | RuleFor(x => x.Code).NotEmpty(); 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Business/Handlers/UserClaims/Queries/GetUserClaimsQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.UserClaims.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetUserClaimsQuery : IRequest>> 14 | { 15 | 16 | public class GetUserClaimsQueryHandler : IRequestHandler>> 17 | { 18 | private readonly IUserClaimRepository _userClaimRepository; 19 | 20 | public GetUserClaimsQueryHandler(IUserClaimRepository userClaimRepository) 21 | { 22 | _userClaimRepository = userClaimRepository; 23 | } 24 | 25 | public async Task>> Handle(GetUserClaimsQuery request, CancellationToken cancellationToken) 26 | { 27 | return new SuccessDataResult>(await _userClaimRepository.GetListAsync()); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Business/Handlers/UserGroups/Queries/GetUserGroupLookupQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Utilities.Results; 3 | using DataAccess.Abstract; 4 | using Core.Entities.Dtos; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.UserGroups.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetUserGroupLookupQuery : IRequest>> 14 | { 15 | public int UserId { get; set; } 16 | public class GetUserGroupLookupQueryHandler : IRequestHandler>> 17 | { 18 | private readonly IUserGroupRepository _userGroupRepository; 19 | 20 | public GetUserGroupLookupQueryHandler(IUserGroupRepository userGroupRepository) 21 | { 22 | _userGroupRepository = userGroupRepository; 23 | } 24 | 25 | public async Task>> Handle(GetUserGroupLookupQuery request, CancellationToken cancellationToken) 26 | { 27 | var data = await _userGroupRepository.GetUserGroupSelectedList(request.UserId); 28 | return new SuccessDataResult>(data); 29 | 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Business/Handlers/UserGroups/Queries/GetUserGroupQuery.cs: -------------------------------------------------------------------------------- 1 |  2 | using Business.BusinessAspects; 3 | using Core.Entities.Concrete; 4 | using Core.Utilities.Results; 5 | using DataAccess.Abstract; 6 | using MediatR; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.UserGroups.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetUserGroupQuery : IRequest> 14 | { 15 | public int UserId { get; set; } 16 | 17 | public class GetUserGroupQueryHandler : IRequestHandler> 18 | { 19 | private readonly IUserGroupRepository _userGroupRepository; 20 | 21 | public GetUserGroupQueryHandler(IUserGroupRepository userGroupRepository) 22 | { 23 | _userGroupRepository = userGroupRepository; 24 | } 25 | 26 | public async Task> Handle(GetUserGroupQuery request, CancellationToken cancellationToken) 27 | { 28 | var userGroup = await _userGroupRepository.GetAsync(p => p.UserId == request.UserId); 29 | return new SuccessDataResult(userGroup); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Business/Handlers/UserGroups/Queries/GetUserGroupsQuery.cs: -------------------------------------------------------------------------------- 1 | using Business.BusinessAspects; 2 | using Core.Entities.Concrete; 3 | using Core.Utilities.Results; 4 | using DataAccess.Abstract; 5 | using MediatR; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.UserGroups.Queries 11 | { 12 | [SecuredOperation] 13 | public class GetUserGroupsQuery : IRequest>> 14 | { 15 | public class GetUserGroupsQueryHandler : IRequestHandler>> 16 | { 17 | private readonly IUserGroupRepository _userGroupRepository; 18 | 19 | public GetUserGroupsQueryHandler(IUserGroupRepository userGroupRepository) 20 | { 21 | _userGroupRepository = userGroupRepository; 22 | } 23 | 24 | public async Task>> Handle(GetUserGroupsQuery request, CancellationToken cancellationToken) 25 | { 26 | return new SuccessDataResult>(await _userGroupRepository.GetListAsync()); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Business/Handlers/UserGroups/Queries/GetUsersInGroupLookupByGroupId.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results; 2 | using DataAccess.Abstract; 3 | using Core.Entities.Dtos; 4 | using MediatR; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Business.Handlers.UserGroups.Queries 10 | { 11 | public class GetUsersInGroupLookupByGroupId : IRequest>> 12 | { 13 | public int GroupId { get; set; } 14 | 15 | public class GetUsersInGroupLookupByGroupIdHandler : IRequestHandler>> 16 | { 17 | IUserGroupRepository _userGroupRepository; 18 | 19 | public GetUsersInGroupLookupByGroupIdHandler(IUserGroupRepository userGroupRepository) 20 | { 21 | _userGroupRepository = userGroupRepository; 22 | } 23 | 24 | public async Task>> Handle(GetUsersInGroupLookupByGroupId request, CancellationToken cancellationToken) 25 | { 26 | return new SuccessDataResult> 27 | (await _userGroupRepository.GetUsersInGroupSelectedListByGroupId(request.GroupId)); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Business/Handlers/Users/Queries/GetUserLookupQuery.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results; 2 | using DataAccess.Abstract; 3 | using Core.Entities.Dtos; 4 | using MediatR; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Business.Handlers.Users.Queries 11 | { 12 | public class GetUserLookupQuery : IRequest>> 13 | { 14 | public class GetUserLookupQueryHandler : IRequestHandler>> 15 | { 16 | private readonly IUserRepository _userRepository; 17 | public GetUserLookupQueryHandler(IUserRepository userRepository) 18 | { 19 | _userRepository = userRepository; 20 | } 21 | public async Task>> Handle(GetUserLookupQuery request, CancellationToken cancellationToken) 22 | { 23 | var list = await _userRepository.GetListAsync(x => x.Status); 24 | 25 | var userLookup = list.Select(x => new SelectionItem() 26 | { 27 | Id = x.UserId.ToString(), 28 | Label = x.FullName 29 | }); 30 | return new SuccessDataResult>(userLookup); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Business/Helpers/AutoMapperHelper.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Core.Entities.Concrete; 3 | using Core.Entities.Dtos; 4 | 5 | namespace Business.Helpers 6 | { 7 | public class AutoMapperHelper : Profile 8 | { 9 | public AutoMapperHelper() 10 | { 11 | CreateMap().ReverseMap(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Business/Helpers/AwaitableLock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Business.Helpers 6 | { 7 | /// 8 | /// Since we cannot lock the async await binary with the classic C # lock () clause, we are referring to this solution. 9 | /// 10 | public class AwaitableLock 11 | { 12 | private readonly SemaphoreSlim _toLock; 13 | 14 | public AwaitableLock() 15 | { 16 | _toLock = new SemaphoreSlim(1, 1); 17 | } 18 | 19 | public async Task Lock(TimeSpan timeout) 20 | { 21 | if (await _toLock.WaitAsync(timeout)) 22 | { 23 | return new LockReleaser(_toLock); 24 | } 25 | throw new TimeoutException(); 26 | } 27 | 28 | public struct LockReleaser : IDisposable 29 | { 30 | private readonly SemaphoreSlim _toRelease; 31 | 32 | public LockReleaser(SemaphoreSlim toRelease) 33 | { 34 | _toRelease = toRelease; 35 | } 36 | public void Dispose() 37 | { 38 | _toRelease.Release(); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Business/Services/Authentication/AgentAuthenticationProvider.cs: -------------------------------------------------------------------------------- 1 | using Business.Services.Authentication.Model; 2 | using Core.Utilities.Results; 3 | using System; 4 | using System.Threading.Tasks; 5 | 6 | namespace Business.Services.Authentication 7 | { 8 | public class AgentAuthenticationProvider : IAuthenticationProvider 9 | { 10 | public Task Login(LoginUserCommand command) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual Task> Verify(VerifyOtpCommand command) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Business/Services/Authentication/AuthenticationCoordinator.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | 4 | namespace Business.Services.Authentication 5 | { 6 | /// 7 | /// Çok hızlı yazmak zorunda kaldım, refactor gerekecek. 8 | /// 9 | public class AuthenticationCoordinator : IAuthenticationCoordinator 10 | { 11 | private readonly IServiceProvider _serviceProvider; 12 | 13 | public AuthenticationCoordinator(IServiceProvider serviceProvider) 14 | { 15 | _serviceProvider = serviceProvider; 16 | } 17 | 18 | 19 | 20 | public IAuthenticationProvider SelectProvider(AuthenticationProviderType type) 21 | { 22 | return type switch 23 | { 24 | AuthenticationProviderType.Person => (IAuthenticationProvider)_serviceProvider.GetService(typeof(PersonAuthenticationProvider)), 25 | AuthenticationProviderType.Agent => (IAuthenticationProvider)_serviceProvider.GetService(typeof(AgentAuthenticationProvider)), 26 | _ => throw new ApplicationException($"Authentication provider not found: {type}") 27 | }; 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Business/Services/Authentication/DArchToken.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Security.Jwt; 2 | using Core.Entities; 3 | 4 | namespace Business.Services.Authentication 5 | { 6 | public class DArchToken : AccessToken 7 | { 8 | public string ExternalUserId { get; set; } 9 | /// 10 | /// AuthenticationProviderType'a karşılık gelir. 11 | /// 12 | public AuthenticationProviderType Provider { get; set; } 13 | /// 14 | /// Eğer bu özellik dolu dönerse login olan kullanıcı bilgisi yanında aşağıdaki 15 | /// bağışçı alınmış gibi varsayılabilir. 16 | /// 17 | public string OnBehalfOf { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Business/Services/Authentication/IAuthenticationCoordinator.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | 3 | namespace Business.Services.Authentication 4 | { 5 | public interface IAuthenticationCoordinator 6 | { 7 | IAuthenticationProvider SelectProvider(AuthenticationProviderType type); 8 | } 9 | } -------------------------------------------------------------------------------- /Business/Services/Authentication/IAuthenticationProvider.cs: -------------------------------------------------------------------------------- 1 | using Business.Services.Authentication.Model; 2 | using Core.Utilities.Results; 3 | using System.Threading.Tasks; 4 | 5 | namespace Business.Services.Authentication 6 | { 7 | public interface IAuthenticationProvider 8 | { 9 | Task Login(LoginUserCommand command); 10 | Task> Verify(VerifyOtpCommand command); 11 | } 12 | } -------------------------------------------------------------------------------- /Business/Services/Authentication/Model/LoginUserResult.cs: -------------------------------------------------------------------------------- 1 | namespace Business.Services.Authentication.Model 2 | { 3 | /// 4 | /// It is the return data of the login function. 5 | /// 6 | public class LoginUserResult 7 | { 8 | /// 9 | /// Login query result. 10 | /// 11 | public LoginStatus Status { get; set; } 12 | /// 13 | /// Additional message 14 | /// 15 | public string Message { get; set; } 16 | /// 17 | /// List of registered phone numbers for users in the system. 18 | /// 19 | public string[] MobilePhones { get; set; } 20 | 21 | public enum LoginStatus 22 | { 23 | UserNotFound, 24 | WrongCredentials, 25 | PhoneNumberRequired, 26 | ServiceError, 27 | Ok 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Business/Services/Authentication/Model/VerifyOTPCommand.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results; 2 | using Core.Entities; 3 | using MediatR; 4 | 5 | namespace Business.Services.Authentication.Model 6 | { 7 | /// 8 | /// It is the command sent to the user for One Time Password control. 9 | /// 10 | public class VerifyOtpCommand : IRequest> 11 | { 12 | public AuthenticationProviderType Provider { get; set; } 13 | /// 14 | /// Specifies the subtype so that the same provider user can enter from different systems. 15 | /// 16 | public string ProviderSubType { get; set; } 17 | public string ExternalUserId { get; set; } 18 | public int Code { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Core/ApiDoc/EnumSchemaFilter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.OpenApi.Any; 2 | using Microsoft.OpenApi.Models; 3 | using Swashbuckle.AspNetCore.SwaggerGen; 4 | using System; 5 | using System.Linq; 6 | 7 | namespace Core.ApiDoc 8 | { 9 | /// 10 | /// Plugin made to send Enum values and names correctly in APIs. 11 | /// 12 | internal class EnumSchemaFilter : ISchemaFilter 13 | { 14 | public void Apply(OpenApiSchema schema, SchemaFilterContext context) 15 | { 16 | if (context.Type.IsEnum) 17 | { 18 | var enumValues = schema.Enum.ToArray(); 19 | var i = 0; 20 | schema.Enum.Clear(); 21 | foreach (var n in Enum.GetNames(context.Type).ToList()) 22 | { 23 | schema.Enum.Add(new OpenApiString(n)); 24 | schema.Title = ((OpenApiPrimitive)enumValues[i]).Value.ToString(); 25 | i++; 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Caching/CacheRemoveAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.CrossCuttingConcerns.Caching; 3 | using Core.Utilities.Interceptors; 4 | using Core.Utilities.IoC; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace Core.Aspects.Autofac.Caching 8 | { 9 | /// 10 | /// CacheRemoveAspect 11 | /// 12 | public class CacheRemoveAspect : MethodInterception 13 | { 14 | private readonly string _pattern; 15 | private readonly ICacheManager _cacheManager; 16 | public CacheRemoveAspect(string pattern) 17 | { 18 | _pattern = pattern; 19 | _cacheManager = ServiceTool.ServiceProvider.GetService(); 20 | } 21 | protected override void OnSuccess(IInvocation invocation) 22 | { 23 | _cacheManager.RemoveByPattern(_pattern); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Performance/PerformanceAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Utilities.Interceptors; 3 | using Core.Utilities.IoC; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using System.Diagnostics; 6 | 7 | namespace Core.Aspects.Autofac.Performance 8 | { 9 | /// 10 | /// PerformanceAspect 11 | /// 12 | public class PerformanceAspect : MethodInterception 13 | { 14 | private readonly int _interval; 15 | private readonly Stopwatch _stopwatch; 16 | 17 | public PerformanceAspect(int interval) 18 | { 19 | _interval = interval; 20 | _stopwatch = ServiceTool.ServiceProvider.GetService(); 21 | } 22 | 23 | protected override void OnBefore(IInvocation invocation) 24 | { 25 | _stopwatch.Start(); 26 | } 27 | protected override void OnAfter(IInvocation invocation) 28 | { 29 | if (_stopwatch.Elapsed.TotalSeconds > _interval) 30 | { 31 | Debug.WriteLine($"Performance: {invocation.Method.DeclaringType.FullName}.{invocation.Method.Name}-->{_stopwatch.Elapsed.TotalSeconds}"); 32 | } 33 | _stopwatch.Reset(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Transaction/TransactionScopeAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Utilities.Interceptors; 3 | using System.Transactions; 4 | 5 | namespace Core.Aspects.Autofac.Transaction 6 | { 7 | /// 8 | /// TransactionScopeAspect 9 | /// 10 | public class TransactionScopeAspect : MethodInterception 11 | { 12 | public override void Intercept(IInvocation invocation) 13 | { 14 | using (TransactionScope transactionScope = new TransactionScope()) 15 | { 16 | try 17 | { 18 | invocation.Proceed(); 19 | transactionScope.Complete(); 20 | } 21 | catch (System.Exception ex) 22 | { 23 | ex.ToString(); 24 | throw; 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Validation/ValidationAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.CrossCuttingConcerns.Validation; 3 | using Core.Utilities.Interceptors; 4 | using Core.Utilities.Messages; 5 | using FluentValidation; 6 | using System; 7 | using System.Linq; 8 | 9 | namespace Core.Aspects.Autofac.Validation 10 | { 11 | /// 12 | /// ValidationAspect 13 | /// 14 | public class ValidationAspect : MethodInterception 15 | { 16 | private readonly Type _validatorType; 17 | public ValidationAspect(Type validatorType) 18 | { 19 | if (!typeof(IValidator).IsAssignableFrom(validatorType)) 20 | { 21 | throw new ArgumentException(AspectMessages.WrongValidationType); 22 | } 23 | _validatorType = validatorType; 24 | } 25 | protected override void OnBefore(IInvocation invocation) 26 | { 27 | var validator = (IValidator)Activator.CreateInstance(_validatorType); 28 | var entityType = _validatorType.BaseType.GetGenericArguments()[0]; 29 | var entities = invocation.Arguments.Where(t => t.GetType() == entityType); 30 | foreach (var entity in entities) 31 | { 32 | ValidationTool.Validate(validator, entity); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Caching/ICacheManager.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Caching 2 | { 3 | /// 4 | /// Tüm Cache Managerlar bu interface i kullanacaktır. 5 | /// 6 | public interface ICacheManager 7 | { 8 | T Get(string key); 9 | object Get(string key); 10 | void Add(string key, object data, int duration); 11 | bool IsAdd(string key); 12 | void Remove(string key); 13 | void RemoveByPattern(string pattern); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/LogDetail.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Core.CrossCuttingConcerns.Logging 4 | { 5 | public class LogDetail 6 | { 7 | public string FullName { get; set; } 8 | public string MethodName { get; set; } 9 | public string User { get; set; } 10 | public List Parameters { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/LogDetailWithException.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging 2 | { 3 | public class LogDetailWithException : LogDetail 4 | { 5 | public string ExceptionMessage { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/LogParameter.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging 2 | { 3 | public class LogParameter 4 | { 5 | public string Name { get; set; } 6 | public object Value { get; set; } 7 | public string Type { get; set; } 8 | 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/ConfigurationModels/FileLogConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels 2 | { 3 | public class FileLogConfiguration 4 | { 5 | public string FolderPath { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/ConfigurationModels/LogstashConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels 2 | { 3 | public class LogstashConfiguration 4 | { 5 | public string URL { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/ConfigurationModels/MSTeamsConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels 2 | { 3 | public class MSTeamsConfiguration 4 | { 5 | public string ChannelHookAdress { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/ConfigurationModels/MongoDbConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels 2 | { 3 | public class MongoDbConfiguration 4 | { 5 | public string ConnectionString { get; set; } 6 | public string Collection { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/ConfigurationModels/MsSqlConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels 2 | { 3 | public class MsSqlConfiguration 4 | { 5 | public string ConnectionString { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/ConfigurationModels/PostgreConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels 2 | { 3 | public class PostgreConfiguration 4 | { 5 | public string ConnectionString { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/LoggerServiceBase.cs: -------------------------------------------------------------------------------- 1 | using Serilog; 2 | 3 | namespace Core.CrossCuttingConcerns.Logging.Serilog 4 | { 5 | public abstract class LoggerServiceBase 6 | { 7 | public ILogger _logger; 8 | public void Verbose(string message) => _logger.Verbose(message); 9 | public void Fatal(string message) => _logger.Fatal(message); 10 | public void Info(string message) => _logger.Information(message); 11 | public void Warn(string message) => _logger.Warning(message); 12 | public void Debug(string message) => _logger.Debug(message); 13 | public void Error(string message) => _logger.Error(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/Loggers/MSTeamsLogger.cs: -------------------------------------------------------------------------------- 1 | using Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels; 2 | using Core.Utilities.IoC; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Serilog; 6 | using System; 7 | 8 | namespace Core.CrossCuttingConcerns.Logging.Serilog.Loggers 9 | { 10 | public class MSTeamsLogger : LoggerServiceBase 11 | { 12 | public MSTeamsLogger() 13 | { 14 | IConfiguration configuration = ServiceTool.ServiceProvider.GetService(); 15 | 16 | var logConfig = configuration.GetSection("SeriLogConfigurations:MSTeamsConfiguration") 17 | .Get() ?? throw new Exception(Utilities.Messages.SerilogMessages.NullOptionsMessage); 18 | 19 | _logger = new LoggerConfiguration() 20 | .WriteTo.MicrosoftTeams(logConfig.ChannelHookAdress) 21 | .CreateLogger(); 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/Loggers/MongoDbLogger.cs: -------------------------------------------------------------------------------- 1 | using Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels; 2 | using Core.Utilities.IoC; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Serilog; 6 | 7 | namespace Core.CrossCuttingConcerns.Logging.Serilog.Loggers 8 | { 9 | public class MongoDbLogger : LoggerServiceBase 10 | { 11 | public MongoDbLogger() 12 | { 13 | IConfiguration configuration = ServiceTool.ServiceProvider.GetService(); 14 | var logConfig = configuration.GetSection("SeriLogConfigurations:MongoDbConfiguration") 15 | .Get(); 16 | 17 | _logger = new LoggerConfiguration() 18 | .WriteTo.MongoDB(logConfig.ConnectionString, collectionName: logConfig.Collection) 19 | .CreateLogger(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Logging/Serilog/Loggers/MsSqlLogger.cs: -------------------------------------------------------------------------------- 1 | using Core.CrossCuttingConcerns.Logging.Serilog.ConfigurationModels; 2 | using Core.Utilities.IoC; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Serilog; 6 | using Serilog.Sinks.MSSqlServer; 7 | using System; 8 | 9 | namespace Core.CrossCuttingConcerns.Logging.Serilog.Loggers 10 | { 11 | public class MsSqlLogger : LoggerServiceBase 12 | { 13 | public MsSqlLogger() 14 | { 15 | IConfiguration configuration = ServiceTool.ServiceProvider.GetService(); 16 | 17 | var logConfig = configuration.GetSection("SeriLogConfigurations:MsSqlConfiguration") 18 | .Get() ?? throw new Exception(Utilities.Messages.SerilogMessages.NullOptionsMessage); 19 | var sinkOpts = new MSSqlServerSinkOptions { TableName = "Logs",AutoCreateSqlTable=true }; 20 | 21 | var seriLogConfig = new LoggerConfiguration() 22 | .WriteTo.MSSqlServer(connectionString: logConfig.ConnectionString, sinkOptions: sinkOpts) 23 | .CreateLogger(); 24 | _logger = seriLogConfig; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Validation/ValidationTool.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | 3 | namespace Core.CrossCuttingConcerns.Validation 4 | { 5 | public static class ValidationTool 6 | { 7 | public static void Validate(IValidator validator, object entity) 8 | { 9 | var context = new ValidationContext(entity); 10 | 11 | var result = validator.Validate(context); 12 | if (!result.IsValid) 13 | { 14 | throw new ValidationException(result.Errors); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/DataAccess/IDocumentDbRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.Concrete; 2 | using MongoDB.Bson; 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 Core.DataAccess 10 | { 11 | public interface IDocumentDbRepository where T : DocumentDbEntity 12 | { 13 | void Add(T entity); 14 | IQueryable GetList(Expression> predicate = null); 15 | T GetById(ObjectId id); 16 | void AddMany(IEnumerable entities); 17 | void Update(ObjectId id, T record); 18 | void Update(T record, Expression> predicate); 19 | void Delete(ObjectId id); 20 | void Delete(T record); 21 | Task AddAsync(T entity); 22 | Task> GetListAsync(Expression> predicate = null); 23 | Task GetByIdAsync(ObjectId id); 24 | Task AddManyAsync(IEnumerable entities); 25 | Task UpdateAsync(ObjectId id, T record); 26 | Task UpdateAsync(T record, Expression> predicate); 27 | Task DeleteAsync(ObjectId id); 28 | Task DeleteAsync(T record); 29 | bool Any(Expression> predicate = null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Core/DataAccess/IEntityRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core.DataAccess 9 | { 10 | public interface IEntityRepository where T : class, IEntity 11 | { 12 | T Add(T entity); 13 | T Update(T entity); 14 | void Delete(T entity); 15 | IEnumerable GetList(Expression> expression = null); 16 | Task> GetListAsync(Expression> expression = null); 17 | T Get(Expression> expression); 18 | Task GetAsync(Expression> expression); 19 | int SaveChanges(); 20 | Task SaveChangesAsync(); 21 | IQueryable Query(); 22 | Task Execute(FormattableString interpolatedQueryString); 23 | TResult InTransaction(Func action, Action successAction = null, Action exceptionAction = null); 24 | Task GetCountAsync(Expression> expression = null); 25 | int GetCount(Expression> expression = null); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Core/DataAccess/MongoDb/Concrete/Configurations/MongoConnectionSettings.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Driver; 2 | 3 | namespace Core.DataAccess.MongoDb.Concrete.Configurations 4 | { 5 | public class MongoConnectionSettings 6 | { 7 | /// 8 | /// To be set if the MongoClientSetting class is to be used. 9 | /// 10 | private MongoClientSettings _mongoClientSettings { get; set; } 11 | 12 | public string ConnectionString { get; set; } 13 | public string DatabaseName { get; set; } 14 | public MongoConnectionSettings(MongoClientSettings mongoClientSettings) 15 | { 16 | _mongoClientSettings = mongoClientSettings; 17 | } 18 | public MongoConnectionSettings() 19 | { 20 | 21 | } 22 | 23 | public MongoClientSettings GetMongoClientSettings() 24 | { 25 | return _mongoClientSettings; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/AuthenticationProviderType.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities 2 | { 3 | public enum AuthenticationProviderType 4 | { 5 | /// 6 | /// It should not be. Corresponds to the 0 code. It has been added to detect errors. 7 | /// 8 | Unknown, 9 | /// 10 | /// Login for Person 11 | /// 12 | Person, 13 | /// 14 | /// Login for Institution staff 15 | /// 16 | Staff, 17 | /// 18 | /// Login for contract service or outsource personnel. 19 | /// 20 | Agent 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/Group.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Concrete 2 | { 3 | public class Group : IEntity 4 | { 5 | public int Id { get; set; } 6 | public string GroupName { get; set; } 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/GroupClaim.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Concrete 2 | { 3 | public class GroupClaim : IEntity 4 | { 5 | public int GroupId { get; set; } 6 | public int ClaimId { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/Language.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Entities.Concrete 6 | { 7 | public class Language:IEntity 8 | { 9 | public int Id { get; set; } 10 | public string Name { get; set; } 11 | public string Code { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/Log.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core.Entities.Concrete 4 | { 5 | public class Log : IEntity 6 | { 7 | public int Id { get; set; } 8 | public string MessageTemplate { get; set; } 9 | public string Level { get; set; } 10 | public DateTimeOffset TimeStamp { get; set; } 11 | public string Exception { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/MobileLogin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core.Entities 4 | { 5 | public class MobileLogin : IEntity 6 | { 7 | public int Id { get; set; } 8 | public AuthenticationProviderType Provider { get; set; } 9 | public string ExternalUserId { get; set; } 10 | public int Code { get; set; } 11 | public DateTime SendDate { get; set; } 12 | public bool IsSend { get; set; } 13 | public bool IsUsed { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/OperationClaim.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Concrete 2 | { 3 | public class OperationClaim : IEntity 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public string Alias { get; set; } 8 | public string Description { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/Translate.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Core.Entities.Concrete 4 | { 5 | public class Translate:IEntity 6 | { 7 | public int Id { get; set; } 8 | public int LangId { get; set; } 9 | public string Code { get; set; } 10 | public string Value { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/UserClaim.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Concrete 2 | { 3 | public class UserClaim : IEntity 4 | { 5 | public int UserId { get; set; } 6 | public int ClaimId { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/UserGroup.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Concrete 2 | { 3 | public class UserGroup : IEntity 4 | { 5 | public int GroupId { get; set; } 6 | public int UserId { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/UserOperationClaim.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Concrete 2 | { 3 | public class UserOperationClaim : IEntity 4 | { 5 | public int UserId { get; set; } 6 | public int OperationClaimId { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Entities/DocumentDbEntity.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | 3 | namespace Core.DataAccess.Concrete 4 | { 5 | public abstract class DocumentDbEntity 6 | { 7 | public ObjectId Id { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Entities/Dtos/LogDto.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | 4 | namespace Core.Entities.Dtos 5 | { 6 | public class LogDto : IEntity 7 | { 8 | public int Id { get; set; } 9 | public string Level { get; set; } 10 | public string ExceptionMessage { get; set; } 11 | public DateTimeOffset TimeStamp { get; set; } 12 | public string User { get; set; } 13 | public string Value { get; set; } 14 | public string Type { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Entities/Dtos/SelectionItem.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities.Dtos 2 | { 3 | /// 4 | /// Simple selectable lists have been created to return with a single schema through the API. 5 | /// 6 | public class SelectionItem : IDto 7 | { 8 | public SelectionItem() 9 | { 10 | 11 | } 12 | 13 | public SelectionItem(int id, string label) : this(id.ToString(), label) 14 | { 15 | } 16 | 17 | public SelectionItem(string id, string label) 18 | { 19 | this.Id = id; 20 | this.Label = label; 21 | } 22 | 23 | public string Id { get; set; } 24 | public string ParentId { get; set; } 25 | public string Label { get; set; } 26 | public bool IsDisabled { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Core/Entities/Dtos/TranslateDto.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Core.Entities.Dtos 3 | { 4 | public class TranslateDto:IDto 5 | { 6 | public int Id { get; set; } 7 | public string Language { get; set; } 8 | public string Code { get; set; } 9 | public string Value { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Entities/Dtos/UserDto.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Core.Entities.Dtos 4 | { 5 | public class UserDto : IEntity 6 | { 7 | public int UserId { get; set; } 8 | public string FullName { get; set; } 9 | public string Email { get; set; } 10 | public string MobilePhones { get; set; } 11 | public string Address { get; set; } 12 | public string Notes { get; set; } 13 | public int Gender { get; set; } 14 | public string Password { get; set; } 15 | public bool Status { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Entities/IDto.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities 2 | { 3 | public interface IDto 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Core/Entities/IEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Entities 2 | { 3 | public interface IEntity 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Core/Extensions/ClaimExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IdentityModel.Tokens.Jwt; 3 | using System.Linq; 4 | using System.Security.Claims; 5 | 6 | namespace Core.Extensions 7 | { 8 | public static class ClaimExtensions 9 | { 10 | public static void AddEmail(this ICollection claims, string email) 11 | { 12 | claims.Add(new Claim(JwtRegisteredClaimNames.Email, email)); 13 | } 14 | 15 | public static void AddName(this ICollection claims, string name) 16 | { 17 | claims.Add(new Claim(ClaimTypes.Name, name)); 18 | } 19 | 20 | public static void AddNameIdentifier(this ICollection claims, string nameIdentifier) 21 | { 22 | claims.Add(new Claim(ClaimTypes.NameIdentifier, nameIdentifier)); 23 | } 24 | 25 | public static void AddNameUniqueIdentifier(this ICollection claims, string nameUniqueIdentifier) 26 | { 27 | claims.Add(new Claim(ClaimTypes.SerialNumber, nameUniqueIdentifier)); 28 | } 29 | 30 | public static void AddRoles(this ICollection claims, string[] roles) 31 | { 32 | roles.ToList().ForEach(role => claims.Add(new Claim(ClaimTypes.Role, role))); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Extensions/ClaimsPrincipalExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Security.Claims; 4 | 5 | namespace Core.Extensions 6 | { 7 | public static class ClaimsPrincipalExtensions 8 | { 9 | public static List Claims(this ClaimsPrincipal claimsPrincipal, string claimType) 10 | { 11 | var result = claimsPrincipal?.FindAll(claimType)?.Select(x => x.Value).ToList(); 12 | return result; 13 | } 14 | 15 | public static List ClaimRoles(this ClaimsPrincipal claimsPrincipal) 16 | { 17 | return claimsPrincipal?.Claims(ClaimTypes.Role); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Core/Extensions/CloneServiceExtensions.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Core.Extensions 4 | { 5 | public static class CloneServiceExtensions 6 | { 7 | public static T Clone(this T source) 8 | { 9 | if (ReferenceEquals(source, null)) 10 | return default; 11 | 12 | var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace }; 13 | var serializeSettings = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }; 14 | return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source, serializeSettings), deserializeSettings); 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Extensions/DateTimeExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | namespace Core.Extensions 5 | { 6 | public static class DateTimeExtensions 7 | { 8 | public static string ToPrettyDate(this DateTime date, CultureInfo culture) 9 | { 10 | if (culture == null) 11 | { 12 | throw new ArgumentNullException(nameof(culture)); 13 | } 14 | 15 | return date.ToString("yyyyMMdd", culture); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Extensions/EnumExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace Core.Extensions 5 | { 6 | public static class EnumExtensions 7 | { 8 | public static string GetDescription(this T enumValue) 9 | where T : struct, IConvertible 10 | { 11 | if (!typeof(T).IsEnum) 12 | return null; 13 | 14 | var description = enumValue.ToString(); 15 | var fieldInfo = enumValue.GetType().GetField(enumValue.ToString()); 16 | 17 | if (fieldInfo != null) 18 | { 19 | var attrs = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), true); 20 | if (attrs != null && attrs.Length > 0) 21 | { 22 | description = ((DescriptionAttribute)attrs[0]).Description; 23 | } 24 | } 25 | 26 | return description; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Core/Extensions/ErrorDetails.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Core.Extensions 4 | { 5 | public class ErrorDetails 6 | { 7 | public string Message { get; set; } 8 | public int StatusCode { get; set; } 9 | public override string ToString() 10 | { 11 | return JsonConvert.SerializeObject(this); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Core/Extensions/ExceptionMiddlewareExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | 3 | namespace Core.Extensions 4 | { 5 | public static class ExceptionMiddlewareExtensions 6 | { 7 | public static void ConfigureCustomExceptionMiddleware(this IApplicationBuilder app) 8 | { 9 | app.UseMiddleware(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Extensions/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.IoC; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Core.Extensions 6 | { 7 | public static class ServiceCollectionExtensions 8 | { 9 | public static void AddDependencyResolvers(this IServiceCollection services, IConfiguration configuration, ICoreModule[] modules) 10 | { 11 | foreach (var module in modules) 12 | { 13 | module.Load(services, configuration); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Utilities/Business/BusinessRules.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results; 2 | 3 | namespace Core.Utilities.Business 4 | { 5 | public static class BusinessRules 6 | { 7 | public static IResult Run(params IResult[] logics) 8 | { 9 | foreach (var result in logics) 10 | { 11 | if (!result.Success) 12 | { 13 | return result; 14 | } 15 | } 16 | return null; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/IElasticSearch.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.ElasticSearch.Models; 2 | using Core.Utilities.Results; 3 | using Nest; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Utilities.ElasticSearch 8 | { 9 | public interface IElasticSearch 10 | { 11 | Task CreateNewIndexAsync(IndexModel indexModel); 12 | Task InsertAsync(ElasticSearchInsertUpdateModel model); 13 | Task InsertManyAsync(string indexName, object[] items); 14 | IReadOnlyDictionary GetIndexList(); 15 | Task>> GetAllSearch(SearchParameters parameters) where T : class; 16 | Task>> GetSearchByField(SearchByFieldParameters fieldParameters) where T : class; 17 | Task>> GetSearchBySimpleQueryString(SearchByQueryParameters queryParameters) where T : class; 18 | Task UpdateByElasticIdAsync(ElasticSearchInsertUpdateModel model); 19 | Task DeleteByElasticIdAsync(ElasticSearchModel model); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/ElasticSearchConfig.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.ElasticSearch.Models 2 | { 3 | public class ElasticSearchConfig 4 | { 5 | public string ConnectionString { get; set; } 6 | public string UserName { get; set; } 7 | public string Password { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/ElasticSearchGetModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.ElasticSearch.Models 6 | { 7 | public class ElasticSearchGetModel 8 | { 9 | public string ElasticId { get; set; } 10 | public T Item { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/ElasticSearchInsertManyModel.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Core.Utilities.ElasticSearch.Models 3 | { 4 | public class ElasticSearchInsertManyModel:ElasticSearchModel 5 | { 6 | 7 | public object[] Items { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/ElasticSearchInsertUpdateModel.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Core.Utilities.ElasticSearch.Models 3 | { 4 | public class ElasticSearchInsertUpdateModel:ElasticSearchModel 5 | { 6 | public object Item { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/ElasticSearchModel.cs: -------------------------------------------------------------------------------- 1 | using Nest; 2 | namespace Core.Utilities.ElasticSearch.Models 3 | { 4 | public class ElasticSearchModel 5 | { 6 | public Id ElasticId { get; set; } 7 | public string IndexName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/IndexModel.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.ElasticSearch.Models 2 | { 3 | public class IndexModel 4 | { 5 | public string IndexName { get; set; } 6 | public string AliasName { get; set; } 7 | public int NumberOfReplicas { get; set; } = 3; 8 | public int NumberOfShards { get; set; } = 3; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/SearchByFieldParameters.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Core.Utilities.ElasticSearch.Models 3 | { 4 | public class SearchByFieldParameters:SearchParameters 5 | { 6 | public string FieldName { get; set; } 7 | public string Value { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/SearchByQueryParameters.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace Core.Utilities.ElasticSearch.Models 4 | { 5 | public class SearchByQueryParameters:SearchParameters 6 | { 7 | public string QueryName { get; set; } 8 | public string Query { get; set; } 9 | public string[] Fields { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Utilities/ElasticSearch/Models/SearchParameters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.ElasticSearch.Models 6 | { 7 | public class SearchParameters 8 | { 9 | public string IndexName { get; set; } 10 | public int From { get; set; } = 0; 11 | public int Size { get; set; } = 10; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Interceptors/AspectInterceptorSelector.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Aspects.Autofac.Exception; 3 | using Core.CrossCuttingConcerns.Logging.Serilog.Loggers; 4 | using System; 5 | using System.Linq; 6 | using System.Reflection; 7 | 8 | 9 | namespace Core.Utilities.Interceptors 10 | { 11 | public class AspectInterceptorSelector : IInterceptorSelector 12 | { 13 | public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors) 14 | { 15 | var classAttributes = type.GetCustomAttributes(true).ToList(); 16 | var methodAttributes = type.GetMethod(method.Name).GetCustomAttributes(true); 17 | classAttributes.AddRange(methodAttributes); 18 | classAttributes.Add(new ExceptionLogAspect(typeof(FileLogger))); 19 | return classAttributes.OrderBy(x => x.Priority).ToArray(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Core/Utilities/Interceptors/MethodInterceptionBaseAttribute.cs: -------------------------------------------------------------------------------- 1 |  2 | using Castle.DynamicProxy; 3 | using System; 4 | 5 | namespace Core.Utilities.Interceptors 6 | { 7 | /// 8 | /// The Priority property can be used to determine the order in which Aspects will work on methods. 9 | /// 10 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Assembly, AllowMultiple = true, Inherited = true)] 11 | public abstract class MethodInterceptionBaseAttribute : Attribute, IInterceptor 12 | { 13 | public int Priority { get; set; } 14 | 15 | public virtual void Intercept(IInvocation invocation) 16 | { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Core/Utilities/IoC/ICoreModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace Core.Utilities.IoC 5 | { 6 | public interface ICoreModule 7 | { 8 | void Load(IServiceCollection services, IConfiguration configuration); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Utilities/IoC/ServiceTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core.Utilities.IoC 4 | { 5 | public static class ServiceTool 6 | { 7 | public static IServiceProvider ServiceProvider { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/Mail/EmailAddress.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Mail 2 | { 3 | public class EmailAddress 4 | { 5 | public string Name { get; set; } 6 | public string Address { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Utilities/Mail/EmailConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Mail 2 | { 3 | public class EmailConfiguration : IEmailConfiguration 4 | { 5 | public string SmtpServer { get; set; } 6 | 7 | public int SmtpPort { get; set; } 8 | 9 | public string SmtpUserName { get; set; } 10 | 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Mail/EmailMessage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Core.Utilities.Mail 4 | { 5 | public class EmailMessage 6 | { 7 | public EmailMessage() 8 | { 9 | ToAddresses = new List(); 10 | FromAddresses = new List(); 11 | } 12 | public List ToAddresses { get; set; } 13 | public List FromAddresses { get; set; } 14 | public string Subject { get; set; } 15 | public string Content { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Utilities/Mail/IEmailConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Mail 2 | { 3 | public interface IEmailConfiguration 4 | { 5 | string SmtpServer { get; } 6 | int SmtpPort { get; } 7 | string SmtpUserName { get; } 8 | string Password { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Utilities/Mail/IMailService.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Mail 2 | { 3 | public interface IMailService 4 | { 5 | void Send(EmailMessage emailMessage); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/MessageBrokers/RabbitMq/IMessageBrokerHelper.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.MessageBrokers.RabbitMq 2 | { 3 | public interface IMessageBrokerHelper 4 | { 5 | void QueueMessage(string messageText); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/MessageBrokers/RabbitMq/IMessageConsumer.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.MessageBrokers.RabbitMq 2 | { 3 | public interface IMessageConsumer 4 | { 5 | void GetQueue(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/MessageBrokers/RabbitMq/MessageBrokerOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.MessageBrokers.RabbitMq 2 | { 3 | public class MessageBrokerOptions 4 | { 5 | public string HostName { get; set; } 6 | public string UserName { get; set; } 7 | public string Password { get; set; } 8 | public string QueueName { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Utilities/Messages/AspectMessages.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Messages 2 | { 3 | public static class AspectMessages 4 | { 5 | public static string WrongValidationType => "Wrong validation type."; 6 | 7 | public static string WrongLoggerType => "Wrong Logger Type"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/Messages/DocumentDbMessages.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Messages 2 | { 3 | public static class DocumentDbMessages 4 | { 5 | public static string NullOremptyMessage => "Value cannot be null or empty"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/Messages/ExceptionMessage.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Messages 2 | { 3 | public static class ExceptionMessage 4 | { 5 | public static string InternalServerError => "Something went wrong. Please try again."; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/Messages/SerilogMessages.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Messages 2 | { 3 | public static class SerilogMessages 4 | { 5 | public static string NullOptionsMessage => "You have sent a blank value! Something went wrong. Please try again."; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/Messages/SwaggerMessages.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Messages 2 | { 3 | public static class SwaggerMessages 4 | { 5 | public static string Version => "v1"; 6 | public static string Title => "DevArchitecture"; 7 | public static string TermsOfService => "https://DevArchitecture.net/DevArchitectureUIpack.zip"; 8 | public static string ContactName => "DevArchitecture"; 9 | public static string LicenceName => "Use under LICX"; 10 | public static string ContactEMail => "Use under LICX"; 11 | public static string ContactUrl => "https://DevArchitecture.net"; 12 | public static string LicenceUrl => "https://DevArchitecture.net/license"; 13 | public static string Description => @" 14 | [

Download DevArchitecture AngularUI Template
](https://angular.io/assets/images/logos/angular/angular.svg)"; 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Utilities/Results/ApiResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Core.Utilities.Results 4 | { 5 | public class ApiResult 6 | { 7 | public bool Success { get; set; } 8 | public string Message { get; set; } 9 | public string InternalMessage { get; set; } 10 | public T Data { get; set; } 11 | public List Errors { get; set; } 12 | } 13 | 14 | public class ApiReturn : ApiResult 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Utilities/Results/DataResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public class DataResult : Result, IDataResult 4 | { 5 | public DataResult(T data, bool success, string message) : base(success, message) 6 | { 7 | Data = data; 8 | } 9 | 10 | public DataResult(T data, bool success) : base(success) 11 | { 12 | Data = data; 13 | } 14 | 15 | public T Data { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Utilities/Results/ErrorDataResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public class ErrorDataResult : DataResult 4 | { 5 | public ErrorDataResult(T data, string message) : base(data, false, message) 6 | { 7 | } 8 | 9 | public ErrorDataResult(T data) : base(data, false) 10 | { 11 | } 12 | 13 | public ErrorDataResult(string message) : base(default, false, message) 14 | { 15 | 16 | } 17 | 18 | public ErrorDataResult() : base(default, false) 19 | { 20 | 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/Utilities/Results/ErrorResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public class ErrorResult : Result 4 | { 5 | public ErrorResult(string message) : base(false, message) 6 | { 7 | } 8 | 9 | public ErrorResult() : base(false) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Results/IDataResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public interface IDataResult : IResult 4 | { 5 | T Data { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Core/Utilities/Results/IResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public interface IResult 4 | { 5 | bool Success { get; } 6 | string Message { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Result.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public class Result : IResult 4 | { 5 | public Result(bool success, string message) : this(success) 6 | { 7 | Message = message; 8 | } 9 | 10 | public Result(bool success) 11 | { 12 | Success = success; 13 | } 14 | public bool Success { get; } 15 | public string Message { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/Utilities/Results/SuccessDataResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public class SuccessDataResult : DataResult 4 | { 5 | public SuccessDataResult(T data, string message) : base(data, true, message) 6 | { 7 | } 8 | 9 | public SuccessDataResult(T data) : base(data, true) 10 | { 11 | } 12 | 13 | public SuccessDataResult(string message) : base(default, true, message) 14 | { 15 | 16 | } 17 | 18 | public SuccessDataResult() : base(default, true) 19 | { 20 | 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/Utilities/Results/SuccessResult.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Results 2 | { 3 | public class SuccessResult : Result 4 | { 5 | public SuccessResult(string message) : base(true, message) 6 | { 7 | } 8 | 9 | public SuccessResult() : base(true) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Encyption/SecurityKeyHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.IdentityModel.Tokens; 2 | using System.Text; 3 | 4 | namespace Core.Utilities.Security.Encyption 5 | { 6 | public static class SecurityKeyHelper 7 | { 8 | public static SecurityKey CreateSecurityKey(string securityKey) 9 | { 10 | return new SymmetricSecurityKey(Encoding.UTF8.GetBytes(securityKey)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Encyption/SigningCredentialsHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.IdentityModel.Tokens; 2 | 3 | namespace Core.Utilities.Security.Encyption 4 | { 5 | public static class SigningCredentialsHelper 6 | { 7 | public static SigningCredentials CreateSigningCredentials(SecurityKey securityKey) 8 | { 9 | return new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256Signature); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Hashing/HashingHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Cryptography; 2 | using System.Text; 3 | 4 | namespace Core.Utilities.Security.Hashing 5 | { 6 | public static class HashingHelper 7 | { 8 | public static void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt) 9 | { 10 | using (var hmac = new HMACSHA512()) 11 | { 12 | passwordSalt = hmac.Key; 13 | passwordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(password)); 14 | } 15 | } 16 | 17 | public static bool VerifyPasswordHash(string password, byte[] passwordHash, byte[] passwordSalt) 18 | { 19 | using (var hmac = new HMACSHA512(passwordSalt)) 20 | { 21 | var computedHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(password)); 22 | for (int i = 0; i < computedHash.Length; i++) 23 | { 24 | if (computedHash[i] != passwordHash[i]) 25 | { 26 | return false; 27 | } 28 | } 29 | } 30 | 31 | return true; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/AccessToken.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Core.Utilities.Security.Jwt 5 | { 6 | public class AccessToken : IAccessToken 7 | { 8 | public string Token { get; set; } 9 | public DateTime Expiration { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/IAccessToken.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core.Utilities.Security.Jwt 4 | { 5 | public interface IAccessToken 6 | { 7 | DateTime Expiration { get; set; } 8 | string Token { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/ITokenHelper.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using System.Collections.Generic; 3 | 4 | namespace Core.Utilities.Security.Jwt 5 | { 6 | public interface ITokenHelper 7 | { 8 | TAccessToken CreateToken(User user, IEnumerable operationClaims) 9 | where TAccessToken : IAccessToken, new(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/TokenOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.Security.Jwt 2 | { 3 | public class TokenOptions 4 | { 5 | public string Audience { get; set; } 6 | public string Issuer { get; set; } 7 | public int AccessTokenExpiration { get; set; } 8 | public string SecurityKey { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Utilities/Toolkit/RandomPassword.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core.Utilities.Toolkit 4 | { 5 | /// 6 | /// One time password generator for mobile login etc. 7 | /// 8 | public static class RandomPassword 9 | { 10 | public static string CreateRandomPassword(int length = 14) 11 | { 12 | 13 | string validChars = "ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*?_-"; 14 | var random = new Random(); 15 | 16 | char[] chars = new char[length]; 17 | for (int i = 0; i < length; i++) 18 | { 19 | chars[i] = validChars[random.Next(0, validChars.Length)]; 20 | } 21 | return new string(chars); 22 | } 23 | 24 | public static int RandomNumberGenerator(int min = 100000, int max = 999999) 25 | { 26 | var random = new Random(); 27 | return random.Next(min, max); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IGroupClaimRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | using Core.Entities.Dtos; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace DataAccess.Abstract 8 | { 9 | public interface IGroupClaimRepository : IEntityRepository 10 | { 11 | Task> GetGroupClaimsSelectedList(int groupId); 12 | Task BulkInsert(int groupId, IEnumerable groupClaims); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IGroupRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | 4 | namespace DataAccess.Abstract 5 | { 6 | public interface IGroupRepository : IEntityRepository 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DataAccess/Abstract/ILanguageRepository.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Core.DataAccess; 6 | using Core.Entities.Concrete; 7 | using Core.Entities.Dtos; 8 | using Entities.Concrete; 9 | namespace DataAccess.Abstract 10 | { 11 | public interface ILanguageRepository : IEntityRepository 12 | { 13 | Task> GetLanguagesLookUp(); 14 | Task> GetLanguagesLookUpWithCode(); 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /DataAccess/Abstract/ILogRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | namespace DataAccess.Abstract 4 | { 5 | public interface ILogRepository : IEntityRepository 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /DataAccess/Abstract/IMobileLoginRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities; 3 | namespace DataAccess.Abstract 4 | { 5 | public interface IMobileLoginRepository : IEntityRepository 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /DataAccess/Abstract/IOperationClaimRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | 4 | namespace DataAccess.Abstract 5 | { 6 | public interface IOperationClaimRepository : IEntityRepository 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DataAccess/Abstract/ITranslateRepository.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq.Expressions; 5 | using System.Threading.Tasks; 6 | using Core.DataAccess; 7 | using Core.Entities.Concrete; 8 | using Core.Entities.Dtos; 9 | using Entities.Concrete; 10 | namespace DataAccess.Abstract 11 | { 12 | public interface ITranslateRepository : IEntityRepository 13 | { 14 | Task> GetTranslateDto(); 15 | Task> GetTranslateWordList(string lang); 16 | Task GetTranslatesByLang(string langCode); 17 | } 18 | } -------------------------------------------------------------------------------- /DataAccess/Abstract/IUserClaimRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | using Core.Entities.Dtos; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace DataAccess.Abstract 8 | { 9 | public interface IUserClaimRepository : IEntityRepository 10 | { 11 | Task> GetUserClaimSelectedList(int userId); 12 | Task> BulkInsert(int userId, IEnumerable userClaims); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IUserGroupRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | using Core.Entities.Dtos; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace DataAccess.Abstract 8 | { 9 | public interface IUserGroupRepository : IEntityRepository 10 | { 11 | Task> GetUserGroupSelectedList(int userId); 12 | Task> GetUsersInGroupSelectedListByGroupId(int groupId); 13 | Task BulkInsert(int userId, IEnumerable userGroups); 14 | Task BulkInsertByGroupId(int groupId, IEnumerable userGroups); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | using System.Collections.Generic; 4 | 5 | namespace DataAccess.Abstract 6 | { 7 | public interface IUserRepository : IEntityRepository 8 | { 9 | List GetClaims(int userId); 10 | } 11 | } -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/GroupClaimEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class GroupClaimEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => new { x.GroupId, x.ClaimId }); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/GroupEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class GroupEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => x.Id); 12 | builder.Property(x => x.GroupName).HasMaxLength(50).IsRequired(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/LanguageEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class LanguageEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => x.Id); 12 | builder.Property(x => x.Code).HasMaxLength(10).IsRequired(); 13 | builder.Property(x => x.Name).HasMaxLength(10).IsRequired(); 14 | builder.HasData(new Language { Id = 1, Name = "Türkçe", Code = "tr-TR" }, 15 | new Language { Id = 2, Name = "English", Code = "en-US" }); 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/MobileLoginEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class MobileLoginEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => x.Id); 12 | builder.Property(x => x.Code).HasMaxLength(50).IsRequired(); 13 | builder.Property(x => x.Provider) 14 | .IsRequired(); 15 | builder.Property(x => x.ExternalUserId) 16 | .HasMaxLength(20) 17 | .IsRequired(); 18 | builder.Property(x => x.SendDate); 19 | builder.Property(x => x.IsSend); 20 | builder.Property(x => x.IsUsed); 21 | 22 | builder.HasIndex(x => new { x.ExternalUserId, x.Provider }); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/OperationClaimEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class OperationClaimEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => x.Id); 12 | builder.Property(x => x.Name).HasMaxLength(50).IsRequired(); 13 | builder.Property(x => x.Alias).HasMaxLength(50); 14 | builder.Property(x => x.Description).HasMaxLength(100); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/UserClaimEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class UserClaimEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => new { x.UserId, x.ClaimId }); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/UserEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class UserEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => x.UserId); 12 | builder.Property(x => x.CitizenId).IsRequired(); 13 | builder.Property(x => x.FullName).HasMaxLength(100).IsRequired(); 14 | builder.Property(x => x.Email).HasMaxLength(50); 15 | builder.Property(x => x.Status).IsRequired(); 16 | builder.Property(x => x.BirthDate); 17 | builder.Property(x => x.Gender); 18 | builder.Property(x => x.RecordDate); 19 | builder.Property(x => x.Address).HasMaxLength(200); 20 | builder.Property(x => x.MobilePhones).HasMaxLength(30); 21 | builder.Property(x => x.Notes).HasMaxLength(500); 22 | 23 | builder.HasIndex(x => x.CitizenId); 24 | builder.HasIndex(x => x.MobilePhones); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DataAccess/Concrete/Configurations/UserGroupEntityConfiguration.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace DataAccess.Concrete.Configurations 6 | { 7 | public class UserGroupEntityConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.HasKey(x => new { x.UserId, x.GroupId }); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/Contexts/MsDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.Configuration; 3 | 4 | namespace DataAccess.Concrete.EntityFramework.Contexts 5 | { 6 | public sealed class MsDbContext : ProjectDbContext 7 | { 8 | public MsDbContext(DbContextOptions options, IConfiguration configuration) : base(options, configuration) 9 | { 10 | } 11 | 12 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 13 | { 14 | if (!optionsBuilder.IsConfigured) 15 | { 16 | base.OnConfiguring(optionsBuilder.UseSqlServer(configuration.GetConnectionString("DArchMsContext"))); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/GroupRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using Core.Entities.Concrete; 3 | using DataAccess.Abstract; 4 | using DataAccess.Concrete.EntityFramework.Contexts; 5 | 6 | namespace DataAccess.Concrete.EntityFramework 7 | { 8 | public class GroupRepository : EfEntityRepositoryBase, IGroupRepository 9 | { 10 | public GroupRepository(ProjectDbContext context) : base(context) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/LogRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Concrete.EntityFramework.Contexts; 3 | using DataAccess.Abstract; 4 | using Core.Entities.Concrete; 5 | 6 | namespace DataAccess.Concrete.EntityFramework 7 | { 8 | public class LogRepository : EfEntityRepositoryBase, ILogRepository 9 | { 10 | public LogRepository(ProjectDbContext context) : base(context) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/MobileLoginRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using DataAccess.Concrete.EntityFramework.Contexts; 4 | using Core.Entities; 5 | 6 | namespace DataAccess.Concrete.EntityFramework 7 | { 8 | public class MobileLoginRepository : EfEntityRepositoryBase, IMobileLoginRepository 9 | { 10 | public MobileLoginRepository(ProjectDbContext context) : base(context) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/OperationClaimRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using Core.Entities.Concrete; 3 | using DataAccess.Abstract; 4 | using DataAccess.Concrete.EntityFramework.Contexts; 5 | 6 | namespace DataAccess.Concrete.EntityFramework 7 | { 8 | public class OperationClaimRepository : EfEntityRepositoryBase, IOperationClaimRepository 9 | { 10 | public OperationClaimRepository(ProjectDbContext context) : base(context) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/MongoDb/Collections/Collections.cs: -------------------------------------------------------------------------------- 1 | namespace DataAccess.Concrete.MongoDb.Collections 2 | { 3 | public static class Collections 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /DataAccess/Concrete/MongoDb/Context/MongoDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace DataAccess.Concrete.MongoDb.Context 4 | { 5 | 6 | public class MongoDbContext : MongoDbContextBase 7 | { 8 | public MongoDbContext(IConfiguration configuration) : base(configuration) 9 | { 10 | 11 | } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/MongoDb/Context/MongoDbContextBase.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.MongoDb.Concrete.Configurations; 2 | using Microsoft.Extensions.Configuration; 3 | 4 | namespace DataAccess.Concrete.MongoDb.Context 5 | { 6 | public abstract class MongoDbContextBase 7 | { 8 | public readonly IConfiguration configuration; 9 | public readonly MongoConnectionSettings mongoConnectionSettings; 10 | 11 | protected MongoDbContextBase(IConfiguration configuration) 12 | { 13 | this.configuration = configuration; 14 | mongoConnectionSettings = configuration.GetSection("MongoDbSettings").Get(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Entities/Concrete/DocumentDbEntityExample.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.Concrete; 2 | 3 | namespace Entities.Concrete 4 | { 5 | public class DocumentDbEntityExample : DocumentDbEntity 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Entities/Concrete/EntityExample.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | 3 | namespace Entities.Concrete 4 | { 5 | public class EntityExample : IEntity 6 | { 7 | public int Id { get; set; } 8 | public string Name { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Entities/Dtos/Citizen.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Dtos 7 | { 8 | public class Citizen : IDto 9 | { 10 | public long CitizenId { get; set; } 11 | public string Name { get; set; } 12 | public string Surname { get; set; } 13 | public int BirthYear { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Entities/Entities.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 1.0.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Tests/Api/UserContollerTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Tests.Helpers; 3 | using Tests.Helpers.TokenHelpers; 4 | using System.Net.Http.Headers; 5 | using System.Threading.Tasks; 6 | using System.Net; 7 | 8 | namespace Tests.Api 9 | { 10 | [TestFixture] 11 | public class UserContollerTest : BaseIntegrationTest 12 | { 13 | [Test] 14 | public async Task GetAll() 15 | { 16 | var token = MockJwtTokens.GenerateJwtToken(ClaimsData.GetClaims()); 17 | _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); 18 | 19 | var response = await _client.GetAsync("api/users/getall"); 20 | 21 | Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Tests/Business/Adapters/PersonServiceHelper.cs: -------------------------------------------------------------------------------- 1 | using Business.Adapters.PersonService; 2 | using Entities.Dtos; 3 | using System.Net; 4 | 5 | namespace Tests.Business.Adapters 6 | { 7 | public class PersonServiceHelper 8 | { 9 | private readonly IPersonService _personService; 10 | 11 | public PersonServiceHelper(IPersonService personService) 12 | { 13 | this._personService = personService; 14 | } 15 | 16 | public bool VerifyId(Citizen citizen) 17 | { 18 | try 19 | { 20 | return _personService.VerifyCid(citizen).Result; 21 | } 22 | catch (WebException) 23 | { 24 | return false; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tests/Business/Adapters/SmsServiceHelper.cs: -------------------------------------------------------------------------------- 1 | using Business.Adapters.SmsService; 2 | 3 | namespace Tests.Business.Adapters 4 | { 5 | public class SmsServiceHelper 6 | { 7 | private readonly ISmsService smsService; 8 | public SmsServiceHelper(ISmsService smsService) 9 | { 10 | this.smsService = smsService; 11 | } 12 | 13 | public bool Send(string password, string text, string cellPhone) 14 | { 15 | return smsService.Send(password, text, cellPhone).Result; 16 | } 17 | public bool SendAsist(string text, string cellPhone) 18 | { 19 | return smsService.SendAsist(text, cellPhone).Result; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Tests/Business/Adapters/SmsServiceTest.cs: -------------------------------------------------------------------------------- 1 | using Business.Adapters.SmsService; 2 | using Moq; 3 | using NUnit.Framework; 4 | 5 | 6 | namespace Tests.Business.Adapters 7 | { 8 | [TestFixture] 9 | public class SmsServiceTest 10 | { 11 | Mock smsService; 12 | SmsServiceHelper smsServiceHelper; 13 | 14 | [SetUp] 15 | public void Setup() 16 | { 17 | smsService = new Mock(); 18 | smsServiceHelper = new SmsServiceHelper(smsService.Object); 19 | 20 | } 21 | 22 | [Test] 23 | [TestCase("11111", "test", "123456")] 24 | public void Send(string password, string text, string cellPhone) 25 | { 26 | smsService.Setup(x => x.Send(password, text, cellPhone)).ReturnsAsync(true); 27 | var result = smsServiceHelper.Send(password, text, cellPhone); 28 | smsService.Verify(x => x.Send(password, text, cellPhone)); 29 | Assert.IsTrue(result); 30 | } 31 | 32 | [Test] 33 | [TestCase("test", "123456")] 34 | public void SendAsist(string text, string cellPhone) 35 | { 36 | smsService.Setup(x => x.SendAsist(text, cellPhone)).ReturnsAsync(true); 37 | var result = smsServiceHelper.SendAsist(text, cellPhone); 38 | smsService.Verify(x => x.SendAsist(text, cellPhone)); 39 | Assert.IsTrue(result); 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Tests/Business/HandlersTest/LogHandlerTests.cs: -------------------------------------------------------------------------------- 1 | using DataAccess.Abstract; 2 | using Moq; 3 | using NUnit.Framework; 4 | using System.Threading.Tasks; 5 | using MediatR; 6 | 7 | namespace Tests.Business.HandlersTest 8 | { 9 | [TestFixture] 10 | public class LogHandlerTests 11 | { 12 | Mock _logRepository; 13 | Mock _mediator; 14 | [SetUp] 15 | public void Setup() 16 | { 17 | _logRepository = new Mock(); 18 | _mediator = new Mock(); 19 | } 20 | 21 | [Test] 22 | public async Task Log_GetQuery_Success() 23 | { 24 | 25 | 26 | } 27 | 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Tests/Core/Extensions/CloneExtesionServiceTest.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Core.Extensions; 3 | using NUnit.Framework; 4 | using Tests.Helpers; 5 | 6 | 7 | namespace Tests.Core.Extensions 8 | { 9 | [TestFixture] 10 | public class CloneExtesionServiceTest 11 | { 12 | [Test] 13 | public void CloneServiceExtensionTest() 14 | { 15 | var _user = DataHelper.GetUser("murat"); 16 | 17 | var cloneUser = _user.Clone(); 18 | 19 | Assert.That(cloneUser, Is.TypeOf(typeof(User))); 20 | Assert.That(cloneUser.FullName, Is.EqualTo(_user.FullName)); 21 | 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Tests/Core/Extensions/EnumExtensionTests.cs: -------------------------------------------------------------------------------- 1 | using Core.Extensions; 2 | using NUnit.Framework; 3 | 4 | namespace Tests.Core.Extensions 5 | { 6 | [TestFixture] 7 | public class EnumExtensionTests 8 | { 9 | [Test] 10 | public void GetDescriptionTest() 11 | { 12 | var description = UserType.Admin.GetDescription(); 13 | 14 | Assert.That(description, Is.EqualTo("Admin")); 15 | } 16 | } 17 | 18 | public enum UserType 19 | { 20 | [System.ComponentModel.Description("Admin")] 21 | Admin = 1, 22 | 23 | [System.ComponentModel.Description("Guess")] 24 | Guess = 2, 25 | 26 | [System.ComponentModel.Description("Office")] 27 | Office = 3 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tests/Helpers/ClaimsData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Security.Claims; 3 | 4 | namespace Tests.Helpers 5 | { 6 | public static class ClaimsData 7 | { 8 | public static List GetClaims() 9 | { 10 | return new List() 11 | { 12 | new Claim("username", "deneme"), 13 | new Claim("email", "test@test.com") 14 | 15 | }; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Helpers/TokenHelpers/BaseIntegrationTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Testing; 2 | using Microsoft.IdentityModel.Tokens; 3 | using NUnit.Framework; 4 | using System.IdentityModel.Tokens.Jwt; 5 | using System.Net.Http; 6 | using WebAPI; 7 | 8 | namespace Tests.Helpers.TokenHelpers 9 | { 10 | [TestFixture] 11 | public abstract class BaseIntegrationTest : WebApplicationFactory 12 | { 13 | 14 | protected HttpClient _client; 15 | 16 | protected WebApplicationFactory Factory => new WebApplicationFactory(); 17 | 18 | public string Issuer { get; } = "www.devarchitecture.com"; 19 | public string Audience { get; } = "www.devarchitecture.com"; 20 | 21 | public SigningCredentials SigningCredentials { get; } 22 | 23 | private static readonly JwtSecurityTokenHandler s_tokenHandler = new JwtSecurityTokenHandler(); 24 | 25 | 26 | 27 | [SetUp] 28 | public void Setup() 29 | { 30 | _client = this.CreateClient(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tests/Helpers/TokenHelpers/MockJwtTokens.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.IdentityModel.Tokens; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IdentityModel.Tokens.Jwt; 5 | using System.Security.Claims; 6 | using System.Text; 7 | 8 | namespace Tests.Helpers.TokenHelpers 9 | { 10 | public static class MockJwtTokens 11 | { 12 | public static string Issuer { get; } = "www.devarchitecture.com"; 13 | public static string Audience { get; } = "www.devarchitecture.com"; 14 | public static SecurityKey SecurityKey { get; } 15 | public static SigningCredentials SigningCredentials { get; } 16 | 17 | private static readonly JwtSecurityTokenHandler s_tokenHandler = new JwtSecurityTokenHandler(); 18 | private static string KeyString = "!z2x3C4v5B*_*!z2x3C4v5B*_*"; 19 | 20 | static MockJwtTokens() 21 | { 22 | var s_key = Encoding.UTF8.GetBytes(KeyString); 23 | SecurityKey = new SymmetricSecurityKey(s_key); 24 | SigningCredentials = new SigningCredentials(SecurityKey, SecurityAlgorithms.HmacSha256Signature); 25 | 26 | } 27 | 28 | public static string GenerateJwtToken(IEnumerable claims, double value = 5) 29 | { 30 | return s_tokenHandler.WriteToken(new JwtSecurityToken(Issuer, Audience, claims, DateTime.UtcNow, DateTime.UtcNow.AddSeconds(value), SigningCredentials)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tests/MockInterfaces/IDbSets.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Core.Entities; 3 | 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | namespace Tests.MockInterfaces 7 | { 8 | public interface IDbSets 9 | { 10 | 11 | DbSet OperationClaims { get; set; } 12 | DbSet UserClaims { get; set; } 13 | DbSet Groups { get; set; } 14 | DbSet UserGroups { get; set; } 15 | DbSet Users { get; set; } 16 | DbSet GroupClaims { get; set; } 17 | DbSet Logs { get; set; } 18 | DbSet MobileLogins { get; set; } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tests/Services/Authentication/TokenTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Tests.Helpers; 3 | using Tests.Helpers.TokenHelpers; 4 | using System.Net; 5 | using System.Net.Http.Headers; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Tests.Services.Authentication 10 | { 11 | [TestFixture] 12 | public class TokenTest : BaseIntegrationTest 13 | { 14 | [Test] 15 | public async Task TokenAthorizeTest() 16 | { 17 | var token = MockJwtTokens.GenerateJwtToken(ClaimsData.GetClaims()); 18 | _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); 19 | 20 | var response = await _client.GetAsync("api/users/getall"); 21 | 22 | Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); 23 | 24 | } 25 | 26 | [Test] 27 | public async Task TokenExpiredTest() 28 | { 29 | var token = MockJwtTokens.GenerateJwtToken(ClaimsData.GetClaims()); 30 | _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); 31 | 32 | Thread.Sleep(10000); 33 | 34 | var response = await _client.GetAsync("api/users/getall"); 35 | Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode); 36 | 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /UiPreparation/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | 5 | namespace UiPreparation 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | var path = Environment.CurrentDirectory.Substring(0, Environment.CurrentDirectory.IndexOf("bin")); 12 | var exePath = Path.Combine(path, "UI"); 13 | var deletePath = exePath + @"\node_modules\selenium-webdriver\lib\test\data"; 14 | StringBuilder bld = new StringBuilder(); 15 | 16 | bld.Append("npm install -g @angular/cli@latest&"); 17 | bld.Append("npm install&"); 18 | bld.Append("npm install popper.js --save&"); 19 | bld.Append("code .&"); 20 | bld.Append($"RD /S /Q {deletePath} &"); 21 | bld.Append("npm run start&"); 22 | 23 | 24 | System.Diagnostics.Process cmd = new System.Diagnostics.Process(); 25 | cmd.StartInfo.UseShellExecute = false; 26 | cmd.StartInfo.FileName = "cmd.exe"; 27 | cmd.StartInfo.WorkingDirectory = exePath; 28 | cmd.StartInfo.Arguments = @"/c " + bld.ToString(); 29 | cmd.Start(); 30 | Console.ReadLine(); 31 | cmd.WaitForExit(); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /UiPreparation/UI/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /UiPreparation/UI/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class MaterialDashboardAngularPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /UiPreparation/UI/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | beforeLaunch: function() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | }, 27 | onPrepare() { 28 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/app/app.component.css -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | }).compileComponents(); 12 | })); 13 | 14 | it('should create the app', async(() => { 15 | const fixture = TestBed.createComponent(AppComponent); 16 | const app = fixture.debugElement.componentInstance; 17 | expect(app).toBeTruthy(); 18 | })); 19 | 20 | it(`should have as title 'app works!'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app works!'); 24 | })); 25 | 26 | it('should render title in a h1 tag', async(() => { 27 | const fixture = TestBed.createComponent(AppComponent); 28 | fixture.detectChanges(); 29 | const compiled = fixture.debugElement.nativeElement; 30 | expect(compiled.querySelector('h1').textContent).toContain('app works!'); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { TranslateService } from '@ngx-translate/core'; 3 | 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | templateUrl: './app.component.html', 8 | styleUrls: ['./app.component.css'] 9 | }) 10 | export class AppComponent { 11 | 12 | constructor(private translate:TranslateService){ 13 | translate.setDefaultLang("tr-TR"); 14 | translate.use('tr-TR') 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule, } from '@angular/common'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | import { Routes, RouterModule } from '@angular/router'; 5 | import { AdminLayoutComponent } from './core/components/app/layouts/admin-layout/admin-layout.component'; 6 | // import { AdminLayoutComponent } from './layouts/admin-layout/admin-layout.component'; 7 | // import { LoginComponent } from './login/login.component'; 8 | 9 | const routes: Routes =[ 10 | { 11 | path: '', 12 | redirectTo: 'dashboard', 13 | pathMatch: 'full', 14 | }, 15 | 16 | 17 | { 18 | path: '', 19 | component: AdminLayoutComponent, 20 | children: [{ 21 | path: '', 22 | // loadChildren: './core/components/app/layouts/admin-layout/admin-layout.module#AdminLayoutModule' 23 | loadChildren: './core/modules/admin-layout.module#AdminLayoutModule' 24 | }] 25 | } 26 | ]; 27 | 28 | @NgModule({ 29 | imports: [ 30 | CommonModule, 31 | BrowserModule, 32 | RouterModule.forRoot(routes,{ 33 | useHash: true 34 | }) 35 | ], 36 | exports: [ 37 | [RouterModule] 38 | ], 39 | }) 40 | export class AppRoutingModule { } 41 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/group/Models/Group.ts: -------------------------------------------------------------------------------- 1 | export class Group{ 2 | id:number; 3 | groupName:string; 4 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/group/Services/Group.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { GroupService } from './group.service'; 5 | 6 | describe('Service: Group', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [GroupService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([GroupService], (service: GroupService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/group/group.component.scss: -------------------------------------------------------------------------------- 1 | :host ::ng-deep .multiselect-dropdown .dropdown-btn 2 | { 3 | display: inline-block; 4 | border: 1px solid #adadad; 5 | width: 100%; 6 | padding: 6px 12px; 7 | margin-bottom: 0; 8 | font-size: 12px; 9 | font-weight: 400; 10 | line-height: 1.1; 11 | text-align: left; 12 | vertical-align: middle; 13 | cursor: pointer; 14 | background-image: none; 15 | border-radius: 4px; 16 | 17 | 18 | } 19 | 20 | :host ::ng-deep .multiselect-dropdown .dropdown-btn .selected-item 21 | { 22 | background: #9c27b0 !important; 23 | } 24 | 25 | :host ::ng-deep .multiselect-item-checkbox >input[type=checkbox]:checked + div:before { 26 | background: #9c27b0 !important; 27 | } 28 | 29 | .no-sort::after { 30 | display: none !important; 31 | background-image: url() !important; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/group/group.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { GroupComponent } from './group.component'; 7 | 8 | describe('GroupComponent', () => { 9 | let component: GroupComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ GroupComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(GroupComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/language/language.component.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/language/models/language.ts: -------------------------------------------------------------------------------- 1 | export class Language{ 2 | id?:number; 3 | name:string; 4 | code:string; 5 | 6 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/log/logDto.component.scss: -------------------------------------------------------------------------------- 1 | .card .card-header .card-title { 2 | margin-bottom: 3px !important; 3 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/log/models/logdto.ts: -------------------------------------------------------------------------------- 1 | export class LogDto { 2 | id?: number; 3 | level?: string; 4 | exceptionMessage?: string; 5 | timeStamp?: Date 6 | user?: string; 7 | value?: string; 8 | type?: string; 9 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/log/services/logdto.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Observable } from 'rxjs'; 4 | import { LogDto } from '../models/LogDto'; 5 | import { environment } from 'environments/environment'; 6 | 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class LogDtoService { 12 | 13 | constructor(private httpClient: HttpClient) { } 14 | 15 | 16 | getLogDtoList(): Observable { 17 | 18 | return this.httpClient.get(environment.getApiUrl + '/logs/getall') 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/Services/Auth.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { AuthService } from './auth.service'; 5 | 6 | describe('Service: Auth', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [AuthService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([AuthService], (service: AuthService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/login.component.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/app/core/components/admin/login/login.component.html -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/login.component.scss: -------------------------------------------------------------------------------- 1 | // :host ::ng-deep html, 2 | // body { 3 | // height: 100%; 4 | // } 5 | // :host ::ng-deep body { 6 | // display: flex; 7 | // align-items: center; 8 | // padding-top: 40px; 9 | // padding-bottom: 40px; 10 | // background-color: #f5f5f5; 11 | // } 12 | 13 | // :host ::ng-deep .form-signin { 14 | // width: 100%; 15 | // max-width: 330px; 16 | // padding: 15px; 17 | // margin: auto; 18 | // } 19 | // :host ::ng-deep .form-signin .checkbox { 20 | // font-weight: 400; 21 | // } 22 | // :host ::ng-deep .form-signin .form-control { 23 | // position: relative; 24 | // box-sizing: border-box; 25 | // height: auto; 26 | // padding: 10px; 27 | // font-size: 16px; 28 | // } 29 | // :host ::ng-deep .form-signin .form-control:focus { 30 | // z-index: 2; 31 | // } 32 | // :host ::ng-deep .form-signin input[type="email"] { 33 | // margin-bottom: -1px; 34 | // border-bottom-right-radius: 0; 35 | // border-bottom-left-radius: 0; 36 | // } 37 | // :host ::ng-deep .form-signin input[type="password"] { 38 | // margin-bottom: 10px; 39 | // border-top-left-radius: 0; 40 | // border-top-right-radius: 0; 41 | // } 42 | 43 | :host ::ng-deep .card .card-header .card-title { 44 | margin-bottom: 0px !important; 45 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { LoginComponent } from './login.component'; 7 | 8 | describe('LoginComponent', () => { 9 | let component: LoginComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ LoginComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(LoginComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/login.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | height: 100%; 4 | } 5 | body { 6 | display: flex; 7 | align-items: center; 8 | padding-top: 40px; 9 | padding-bottom: 40px; 10 | background-color: #f5f5f5; 11 | } 12 | .form-signin { 13 | width: 100%; 14 | max-width: 330px; 15 | padding: 15px; 16 | margin: auto; 17 | } 18 | .form-signin .checkbox { 19 | font-weight: 400; 20 | } 21 | .form-signin .form-control { 22 | position: relative; 23 | box-sizing: border-box; 24 | height: auto; 25 | padding: 10px; 26 | font-size: 16px; 27 | } 28 | .form-signin .form-control:focus { 29 | z-index: 2; 30 | } 31 | .form-signin input[type="email"] { 32 | margin-bottom: -1px; 33 | border-bottom-right-radius: 0; 34 | border-bottom-left-radius: 0; 35 | } 36 | .form-signin input[type="password"] { 37 | margin-bottom: 10px; 38 | border-top-left-radius: 0; 39 | border-top-right-radius: 0; 40 | } 41 | 42 | .card .card-header .card-title { 43 | margin-bottom: 0px !important; 44 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/model/login-user.ts: -------------------------------------------------------------------------------- 1 | export class LoginUser 2 | { 3 | email:string; 4 | password:string; 5 | lang:string 6 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/login/model/token-model.ts: -------------------------------------------------------------------------------- 1 | export class TokenModel{ 2 | success:boolean; 3 | message:string; 4 | data:Data; 5 | 6 | } 7 | 8 | export class Data { 9 | expiration:string; 10 | token:string; 11 | 12 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/operationclaim/models/operationclaim.ts: -------------------------------------------------------------------------------- 1 | export class OperationClaim { 2 | id: number; 3 | name:string; 4 | alias: string; 5 | description: string; 6 | 7 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/operationclaim/operationClaim.component.scss: -------------------------------------------------------------------------------- 1 | .no-sort::after { 2 | display: none !important; 3 | background-image: url() !important; 4 | } 5 | 6 | 7 | 8 | .card [class*=card-header-]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) { 9 | border-radius: 3px; 10 | margin-top: -20px; 11 | padding: 15px 15px 44px !important; 12 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/operationclaim/services/operationclaim.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import {environment} from "environments/environment" 4 | import { Observable } from 'rxjs'; 5 | import { OperationClaim } from '../Models/OperationClaim'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class OperationClaimService { 11 | 12 | constructor(private httpClient: HttpClient) { } 13 | 14 | 15 | getOperationClaimList(): Observable { 16 | 17 | return this.httpClient.get(environment.getApiUrl + '/operationClaims/getall') 18 | } 19 | 20 | getOperationClaim(id: number): Observable { 21 | return this.httpClient.get(environment.getApiUrl + '/operationClaims/getbyid?id='+id) 22 | } 23 | 24 | updateOperationClaim(operationClaim: OperationClaim): Observable { 25 | return this.httpClient.put(environment.getApiUrl + '/operationClaims/', operationClaim, { responseType: 'text' }); 26 | 27 | } 28 | 29 | 30 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/translate/models/translate.ts: -------------------------------------------------------------------------------- 1 | export class Translate{ 2 | id?:number; 3 | langid?:number; 4 | code?:string; 5 | value?:string; 6 | 7 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/translate/models/translateDto.ts: -------------------------------------------------------------------------------- 1 | 2 | export class translateDto { 3 | 4 | id: number; 5 | language: string; 6 | code: string; 7 | value: string; 8 | 9 | } 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/translate/translate.component.scss: -------------------------------------------------------------------------------- 1 | // .no-sort::after { 2 | // display: none !important; 3 | // background-image: url() !important; 4 | // } 5 | 6 | // .no-sort { 7 | // pointer-events: none !important; 8 | // cursor: default !important; 9 | // background-image: url() !important; 10 | // } 11 | 12 | // .card .card-header .card-title { 13 | // margin-bottom: -28px !important; 14 | // } 15 | 16 | // table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc, table.dataTable thead .sorting_asc_disabled, table.dataTable thead .sorting_desc_disabled { 17 | // /* cursor: pointer; 18 | // *cursor: hand; 19 | // background-repeat: no-repeat;*/ 20 | // background-position: center left !important; 21 | // } 22 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/user/Services/User.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { UserService } from './user.service'; 5 | 6 | describe('Service: User', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [UserService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([UserService], (service: UserService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/user/models/User.ts: -------------------------------------------------------------------------------- 1 | export class User { 2 | userId: number; 3 | fullName: string; 4 | email: string; 5 | address: string; 6 | notes: string; 7 | status: boolean; 8 | mobilePhones: string; 9 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/user/models/passwordDto.ts: -------------------------------------------------------------------------------- 1 | export class PasswordDto 2 | { 3 | userId:number; 4 | password:string; 5 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/user/user.component.scss: -------------------------------------------------------------------------------- 1 | :host ::ng-deep .multiselect-dropdown .dropdown-btn 2 | { 3 | display: inline-block; 4 | border: 1px solid #adadad; 5 | width: 100%; 6 | padding: 6px 12px; 7 | margin-bottom: 0; 8 | font-size: 12px; 9 | font-weight: 400; 10 | line-height: 1.1; 11 | text-align: left; 12 | vertical-align: middle; 13 | cursor: pointer; 14 | background-image: none; 15 | border-radius: 4px; 16 | 17 | 18 | } 19 | 20 | :host ::ng-deep .multiselect-dropdown .dropdown-btn .selected-item 21 | { 22 | background: #9c27b0 !important; 23 | } 24 | 25 | :host ::ng-deep .multiselect-item-checkbox >input[type=checkbox]:checked + div:before { 26 | background: #9c27b0 !important; 27 | } 28 | 29 | .no-sort::after { 30 | display: none !important; 31 | background-image: url() !important; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/admin/user/user.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { UserComponent } from './user.component'; 7 | 8 | describe('UserComponent', () => { 9 | let component: UserComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ UserComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(UserComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/app/core/components/app/dashboard/dashboard.component.css -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/dashboard/dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DashboardComponent } from './dashboard.component'; 4 | 5 | describe('DashboardComponent', () => { 6 | let component: DashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/footer/footer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/app/core/components/app/footer/footer.component.css -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | test : Date = new Date(); 10 | 11 | constructor() { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/layouts/admin-layout/admin-layout.component.html: -------------------------------------------------------------------------------- 1 |
2 | 6 |
7 | 8 | 9 | 10 |
11 | 12 |
-------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/layouts/admin-layout/admin-layout.component.scss: -------------------------------------------------------------------------------- 1 | tbody{height: 400px; overflow-y: scroll;display:block;} 2 | th { position: sticky; top: 0; } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/layouts/admin-layout/admin-layout.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminLayoutComponent } from './admin-layout.component'; 4 | 5 | describe('AdminLayoutComponent', () => { 6 | let component: AdminLayoutComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminLayoutComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminLayoutComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | .nav-item{ 2 | padding-right: 5px; 3 | } 4 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/navbar/navbar.component.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/navbar/navbar.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NavbarComponent } from './navbar.component'; 4 | 5 | describe('NavbarComponent', () => { 6 | let component: NavbarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NavbarComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NavbarComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ElementRef } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { AuthService } from '../../admin/login/services/auth.service'; 4 | 5 | 6 | @Component({ 7 | selector: 'app-navbar', 8 | templateUrl: './navbar.component.html', 9 | styleUrls: ['./navbar.component.css'] 10 | }) 11 | export class NavbarComponent implements OnInit { 12 | 13 | userName: string; 14 | constructor(private authService: AuthService, private router: Router) { 15 | 16 | } 17 | 18 | isLoggedIn(): boolean { 19 | 20 | return this.authService.loggedIn(); 21 | } 22 | 23 | logOut() { 24 | this.authService.logOut(); 25 | this.router.navigateByUrl("/login"); 26 | 27 | } 28 | 29 | help(): void{ 30 | 31 | window.open( 32 | 'https://calm-moss-01a78bc03.azurestaticapps.net', 33 | '_blank' 34 | ); 35 | } 36 | ngOnInit() { 37 | console.log(this.userName); 38 | this.userName = this.authService.getUserName(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/sidebar/sidebar.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/app/core/components/app/sidebar/sidebar.component.css -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/components/app/sidebar/sidebar.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SidebarComponent } from './sidebar.component'; 4 | 5 | describe('SidebarComponent', () => { 6 | let component: SidebarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SidebarComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SidebarComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/directives/must-match.ts: -------------------------------------------------------------------------------- 1 | import { FormGroup } from '@angular/forms'; 2 | 3 | // custom validator to check that two fields match 4 | export function MustMatch(controlName: string, matchingControlName: string) { 5 | return (formGroup: FormGroup) => { 6 | const control = formGroup.controls[controlName]; 7 | const matchingControl = formGroup.controls[matchingControlName]; 8 | 9 | if (matchingControl.errors && !matchingControl.errors.mustMatch) { 10 | // return if another validator has already found an error on the matchingControl 11 | return; 12 | } 13 | 14 | // set error on matchingControl if validation fails 15 | if (control.value !== matchingControl.value) { 16 | matchingControl.setErrors({ mustMatch: true }); 17 | } else { 18 | matchingControl.setErrors(null); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/guards/login-guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from "@angular/router"; 3 | import { Observable } from "rxjs"; 4 | import { AuthService } from "../components/admin/login/services/auth.service"; 5 | import { LocalStorageService } from "../services/local-storage.service"; 6 | 7 | 8 | @Injectable() 9 | export class LoginGuard implements CanActivate { 10 | 11 | constructor(private router: Router, storageService: LocalStorageService, private authService: AuthService) { } 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable | Promise { 14 | console.log(this.authService.loggedIn()); 15 | if (this.authService.loggedIn()){ 16 | return true; 17 | } 18 | this.router.navigate(["login"]); 19 | return false; 20 | 21 | } 22 | 23 | 24 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/interceptors/auth-interceptor.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { AuthInterceptorService } from './auth-interceptor.service'; 5 | 6 | describe('Service: AuthInterceptor', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [AuthInterceptorService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([AuthInterceptorService], (service: AuthInterceptorService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/models/LookUp.ts: -------------------------------------------------------------------------------- 1 | export class LookUp 2 | { 3 | id:any; 4 | label:string; 5 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/modules/components.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | import { FooterComponent } from '../components/app/footer/footer.component'; 5 | import { NavbarComponent } from '../components/app/navbar/navbar.component'; 6 | import { SidebarComponent } from '../components/app/sidebar/sidebar.component'; 7 | import { TranslateModule } from '@ngx-translate/core'; 8 | 9 | 10 | @NgModule({ 11 | imports: [ 12 | CommonModule, 13 | RouterModule, 14 | TranslateModule, 15 | ], 16 | declarations: [ 17 | FooterComponent, 18 | NavbarComponent, 19 | SidebarComponent 20 | ], 21 | exports: [ 22 | FooterComponent, 23 | NavbarComponent, 24 | SidebarComponent 25 | ] 26 | }) 27 | export class ComponentsModule { } 28 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/Alertify.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { AlertifyService } from './alertify.service'; 5 | 6 | describe('Service: Alertify', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [AlertifyService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([AlertifyService], (service: AlertifyService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/LookUp.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { LookUpService } from './lookUp.service'; 5 | 6 | describe('Service: LookUp', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [LookUpService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([LookUpService], (service: LookUpService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/LookUp.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { environment } from 'environments/environment'; 4 | import { Observable } from 'rxjs'; 5 | import { LookUp } from '../models/lookUp'; 6 | 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class LookUpService { 12 | 13 | constructor(private httpClient: HttpClient) { } 14 | 15 | getGroupLookUp(): Observable { 16 | 17 | return this.httpClient.get(environment.getApiUrl + "/Groups/getgrouplookup") 18 | } 19 | 20 | getOperationClaimLookUp(): Observable { 21 | 22 | return this.httpClient.get(environment.getApiUrl + "/OperationClaims/getoperationclaimlookup") 23 | } 24 | 25 | getUserLookUp():Observable{ 26 | return this.httpClient.get(environment.getApiUrl + "/Users/getuserlookup") 27 | } 28 | 29 | getLanguageLookup():Observable{ 30 | return this.httpClient.get(environment.getApiUrl + "/Languages/getlookup") 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/Translation.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { TranslationService } from './translation.service'; 5 | 6 | describe('Service: Translation', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [TranslationService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([TranslationService], (service: TranslationService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/Translation.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs/Observable'; 4 | import { TranslateLoader } from '@ngx-translate/core'; 5 | import { environment } from 'environments/environment'; 6 | import 'rxjs/Rx'; 7 | 8 | @Injectable() 9 | 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class TranslationService implements TranslateLoader { 14 | 15 | constructor(private http: HttpClient) { } 16 | 17 | getTranslation(lang: string): Observable { 18 | return this.http.get(environment.getApiUrl + '/translates/gettranslatesbylang?lang='+lang,{responseType:"json"}); 19 | } 20 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/local-storage.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async, inject } from '@angular/core/testing'; 4 | import { LocalStorageService } from './local-storage.service'; 5 | 6 | describe('Service: LocalStorage', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | providers: [LocalStorageService] 10 | }); 11 | }); 12 | 13 | it('should ...', inject([LocalStorageService], (service: LocalStorageService) => { 14 | expect(service).toBeTruthy(); 15 | })); 16 | }); 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/app/core/services/local-storage.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class LocalStorageService { 7 | 8 | constructor() { } 9 | 10 | setToken(token: string) { 11 | localStorage.setItem("token", token); 12 | } 13 | 14 | removeToken(){ 15 | localStorage.removeItem("token"); 16 | } 17 | 18 | removeItem(itemName:string) 19 | { 20 | localStorage.removeItem(itemName); 21 | } 22 | 23 | getToken():string { 24 | return localStorage.getItem("token"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/.gitkeep -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/css/demo.css: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | ========================================================= 4 | * Material Dashboard Angular - v2.4.0 5 | ========================================================= 6 | 7 | * Product Page: https://www.creative-tim.com/product/material-dashboard-angular2 8 | * Copyright 2019 Creative Tim (https://www.creative-tim.com) 9 | * Licensed under MIT (https://github.com/creativetimofficial/material-dashboard-angular2/blob/master/LICENSE.md) 10 | 11 | * Coded by Creative Tim 12 | 13 | ========================================================= 14 | 15 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 16 | 17 | */ 18 | .tim-typo{ 19 | padding-left: 25%; 20 | margin-bottom: 40px; 21 | position: relative; 22 | width: 100%; 23 | } 24 | .tim-typo .tim-note{ 25 | bottom: 5px; 26 | color: #c0c1c2; 27 | display: block; 28 | font-weight: 400; 29 | font-size: 13px; 30 | line-height: 15px; 31 | left: 0; 32 | margin-left: 20px; 33 | position: absolute; 34 | width: 260px; 35 | } 36 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/i18n/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "Login":"login EN", 3 | "email":"Email EN", 4 | "password":"Password EN", 5 | "update:":"Update", 6 | "delete":"Delete", 7 | "UsersGroups":"User's Groups", 8 | "UsersClaims":"User's Claims", 9 | "create":"Create", 10 | "Users":"Users", 11 | "Groups":"Groups" 12 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/i18n/tr-TR.json: -------------------------------------------------------------------------------- 1 | { 2 | "Login":"Giriş TR", 3 | "email":"E posta", 4 | "password":"Parola", 5 | "update:":"Güncelle", 6 | "delete":"Sil", 7 | "UsersGroups":"Kullanıcın Grupları", 8 | "UsersClaims":"Kullanıcın Yetkileri", 9 | "create":"Yeni", 10 | "Users":"Kullanıcılar", 11 | "Groups":"Gruplar" 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/angular.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/angular2-logo-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/angular2-logo-red.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/angular2-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/angular2-logo.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/apple-icon.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/cover.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/cover.jpeg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/faces/marc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/faces/marc.jpg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/favicon.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/gears.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/gears.gif -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/html.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/logo/logo.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/logo/logoşşş.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/logo/logoşşş.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/logo/photo_2020-12-18_21-41-29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/logo/photo_2020-12-18_21-41-29.jpg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/logo/photo_2020-12-18_21-41-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/logo/photo_2020-12-18_21-41-29.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/logo/xxxxlogox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/logo/xxxxlogox.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/mask.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/new_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/new_logo.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/sidebar-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/sidebar-1.jpg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/sidebar-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/sidebar-2.jpg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/sidebar-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/sidebar-3.jpg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/sidebar-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/sidebar-4.jpg -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/img/tim_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/assets/img/tim_80x80.png -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_example-pages.scss: -------------------------------------------------------------------------------- 1 | .card-signup { 2 | .card-header { 3 | .social-line { 4 | .btn { 5 | color: $white-color; 6 | } 7 | } 8 | } 9 | .text-divider { 10 | margin-top: 30px; 11 | margin-bottom: 0px; 12 | text-align: center; 13 | } 14 | } 15 | 16 | .signup-page { 17 | .page-header { 18 | min-height: 100vh; 19 | height: auto; 20 | display: inherit; 21 | 22 | .container{ 23 | padding-top: 20vh; 24 | } 25 | } 26 | 27 | .card-signup { 28 | border-radius: $border-radius-base * 2; 29 | @include shadow-16dp(); 30 | margin-bottom: 100px; 31 | padding: 40px 0px; 32 | 33 | } 34 | .info-horizontal { 35 | padding: 0px 0px 20px; 36 | } 37 | 38 | .social { 39 | .btn { 40 | margin: 5px; 41 | } 42 | h4 { 43 | margin-top: 20px; 44 | } 45 | } 46 | .footer { 47 | .container { 48 | padding: 0; 49 | } 50 | .copyright, 51 | a{ 52 | color: $white-color; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_images.scss: -------------------------------------------------------------------------------- 1 | .img-thumbnail{ 2 | border-radius: 16px; 3 | } 4 | .img-raised{ 5 | @include shadow-big-image(); 6 | } 7 | 8 | .rounded{ 9 | border-radius: $border-radius-large !important; 10 | } 11 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_input-group.scss: -------------------------------------------------------------------------------- 1 | // ----------------------------------------- 2 | // input-group and input-group-addon styles 3 | // note: form-groups are not required 4 | // 5 | @mixin input-group-button-variation($vertical-padding) { 6 | .input-group-btn { 7 | .btn { 8 | //margin: 0 0 $vertical-padding 0; 9 | } 10 | } 11 | } 12 | 13 | // default margin - no form-group required 14 | @include input-group-button-variation(input-padding-y); 15 | 16 | .bmd-form-group-sm { 17 | @include input-group-button-variation($input-padding-y-sm); 18 | } 19 | 20 | .bmd-form-group-lg { 21 | @include input-group-button-variation($input-padding-y-lg); 22 | } 23 | 24 | .input-group { 25 | // may be in or outside of form-group 26 | 27 | .input-group-text { 28 | display: flex; 29 | justify-content: center; 30 | align-items: center; 31 | padding: 0 15px 0 15px; 32 | background-color: transparent; 33 | border-color: transparent; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_mixins.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/utilities"; 2 | @import "mixins/breakpoints"; 3 | @import "mixins/animations"; 4 | @import "mixins/type"; 5 | @import "mixins/layout"; 6 | @import "mixins/drawer"; 7 | @import "mixins/forms"; 8 | @import "mixins/buttons"; 9 | @import "mixins/hover"; 10 | @import "mixins/navs"; 11 | @import "mixins/colored-shadows"; 12 | @import "mixins/navbar-colors"; 13 | @import "mixins/alert"; 14 | @import "mixins/sidebar-color"; 15 | @import "mixins/variables"; 16 | @import "mixins/vendor-prefixes"; 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_popover.scss: -------------------------------------------------------------------------------- 1 | .popover, .tooltip-inner { 2 | line-height: 1.5em; 3 | background: $white-color; 4 | border: none; 5 | border-radius: $border-radius-base; 6 | @include shadow-8dp(); 7 | color: $popover-color; 8 | } 9 | 10 | 11 | .popover{ 12 | padding: 0; 13 | @include shadow-16dp(); 14 | 15 | &.left, 16 | &.right, 17 | &.top, 18 | &.bottom{ 19 | > .arrow{ 20 | border: none; 21 | } 22 | } 23 | 24 | 25 | &.bs-popover-top, 26 | &.bs-popover-auto[x-placement^="top"], 27 | &.bs-popover-bottom, 28 | &.bs-popover-auto[x-placement^="bottom"], 29 | &.bs-popover-right, 30 | &.bs-popover-auto[x-placement^="right"], 31 | &.bs-popover-left, 32 | &.bs-popover-auto[x-placement^="left"]{ 33 | & .arrow::before{ 34 | border: 0; 35 | } 36 | } 37 | 38 | } 39 | 40 | .popover-header{ 41 | background-color: $white-color; 42 | border: none; 43 | padding: 15px 15px 5px; 44 | font-size: $font-size-h4; 45 | margin: 0; 46 | color: $popover-color; 47 | } 48 | 49 | .popover-body{ 50 | padding: 10px 15px 15px; 51 | line-height: 1.4; 52 | color: $popover-color; 53 | } 54 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_ripples.scss: -------------------------------------------------------------------------------- 1 | // marker class (used as a selector for one-off elements to decorate) 2 | .ripple { 3 | position: relative; 4 | } 5 | 6 | .ripple-container { 7 | position: absolute; 8 | top: 0; 9 | left: 0; 10 | z-index: 1; 11 | width: 100%; 12 | height: 100%; 13 | overflow: hidden; 14 | pointer-events: none; 15 | border-radius: inherit; 16 | 17 | .ripple-decorator { 18 | position: absolute; 19 | width: 20px; 20 | height: 20px; 21 | margin-top: -10px; 22 | margin-left: -10px; 23 | pointer-events: none; 24 | background-color: rgba($black, 0.05); 25 | border-radius: 100%; 26 | opacity: 0; 27 | transform: scale(1); 28 | transform-origin: 50%; 29 | 30 | &.ripple-on { 31 | opacity: 0.1; 32 | transition: opacity 0.15s ease-in 0s, 33 | transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s; 34 | } 35 | 36 | &.ripple-out { 37 | opacity: 0; 38 | transition: opacity 0.1s linear 0s !important; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_tooltip.scss: -------------------------------------------------------------------------------- 1 | // This file has been autogenerated by grunt task lessToSass. Any changes will be overwritten. 2 | 3 | .tooltip-inner, .mat-tooltip { 4 | color: $gray !important; 5 | line-height: 1.5em; 6 | background: $white-color; 7 | border: none; 8 | border-radius: $border-radius-base !important; 9 | @include shadow-8dp(); 10 | } 11 | 12 | .tooltip, .tooltip.in { 13 | //opacity: 1; 14 | } 15 | .tooltip.in{ 16 | opacity: 1; 17 | @include transform-translate-y(0px); 18 | } 19 | .tooltip{ 20 | opacity: 0; 21 | transition: opacity, transform .2s ease; 22 | @include transform-translate-y(5px); 23 | 24 | &.left{ 25 | .tooltip-arrow{ 26 | border-left-color: $white-color; 27 | } 28 | } 29 | &.right{ 30 | .tooltip-arrow{ 31 | border-right-color: $white-color; 32 | } 33 | } 34 | &.top{ 35 | .tooltip-arrow{ 36 | border-top-color: $white-color; 37 | } 38 | } 39 | &.bottom{ 40 | .tooltip-arrow{ 41 | border-bottom-color: $white-color; 42 | } 43 | } 44 | } 45 | 46 | .tooltip-inner, .mat-tooltip{ 47 | padding: 10px 15px; 48 | min-width: 130px; 49 | } 50 | 51 | .mat-tooltip{ 52 | text-align: center; 53 | } 54 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/_variables.scss: -------------------------------------------------------------------------------- 1 | @import "variables/colors"; 2 | @import "variables/shadow"; 3 | 4 | @import "variables/bootstrap-material-design-base"; 5 | 6 | // Customized BS variables 7 | @import "variables/custom-forms"; 8 | @import "variables/spacing"; 9 | @import "variables/body"; 10 | @import "variables/brand"; 11 | @import "variables/buttons"; 12 | @import "variables/card"; 13 | @import "variables/code"; 14 | @import "variables/dropdown"; 15 | @import "variables/forms"; 16 | @import "variables/list-group"; 17 | @import "variables/nav"; 18 | @import "variables/pagination"; 19 | @import "variables/state"; 20 | @import "variables/tables"; 21 | @import "variables/tooltip"; 22 | @import "variables/type"; 23 | @import "variables/modals"; 24 | 25 | // import their vars after customization for use below 26 | $enable-flex: true; // fully adopt flexbox layouts 27 | $enable-shadows: true; // enable shadows, set to false to turn off shadows 28 | 29 | 30 | @import "variables/layout"; 31 | @import "variables/menu"; 32 | @import "variables/drawer"; 33 | @import "variables/snackbar"; 34 | 35 | @import "variables/bootstrap-material-design"; 36 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/cards/_card-plain.scss: -------------------------------------------------------------------------------- 1 | .card-plain { 2 | background: transparent; 3 | box-shadow: none; 4 | 5 | .card-header:not(.card-avatar) { 6 | margin-left: 0; 7 | margin-right: 0; 8 | } 9 | 10 | .card-body { 11 | padding-left: 5px; 12 | padding-right: 5px; 13 | } 14 | 15 | .card-header-image { 16 | margin: 0 !important; 17 | border-radius: $border-radius-large; 18 | 19 | img { 20 | border-radius: $border-radius-large; 21 | } 22 | } 23 | .card-footer { 24 | padding-left: 5px; 25 | padding-right: 5px; 26 | background-color: transparent; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/cards/_card-profile.scss: -------------------------------------------------------------------------------- 1 | .card-profile{ 2 | margin-top: 30px; 3 | text-align: center; 4 | 5 | 6 | .card-avatar { 7 | margin: -50px auto 0; 8 | border-radius: 50%; 9 | overflow: hidden; 10 | padding: 0; 11 | 12 | @include shadow-big(); 13 | 14 | & + .card-body { 15 | margin-top: 15px; 16 | } 17 | img { 18 | width: 100%; 19 | height: auto; 20 | } 21 | } 22 | 23 | .card-body + .card-footer { 24 | margin-top: -15px; 25 | } 26 | 27 | .card-footer { 28 | .btn.btn-just-icon { 29 | font-size: 20px; 30 | padding: 12px 12px; 31 | line-height: 1em; 32 | } 33 | } 34 | 35 | &.card-plain { 36 | .card-avatar { 37 | margin-top: 0; 38 | } 39 | } 40 | 41 | .card-header:not([class*="card-header-"]){ 42 | background: transparent; 43 | } 44 | .card-avatar { 45 | max-width: 130px; 46 | max-height: 130px; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/cards/_card-stats.scss: -------------------------------------------------------------------------------- 1 | .card-stats{ 2 | .card-header{ 3 | &.card-header-icon, 4 | &.card-header-text{ 5 | text-align: right; 6 | } 7 | 8 | .card-icon + .card-title, 9 | .card-icon + .card-category{ 10 | padding-top: 10px; 11 | } 12 | 13 | &.card-header-icon .card-title, 14 | &.card-header-text .card-title, 15 | &.card-header-icon .card-category, 16 | &.card-header-text .card-category { 17 | margin: 0; 18 | } 19 | .card-category { 20 | margin-bottom: 0; 21 | margin-top: 0; 22 | 23 | &:not([class*="text-"]){ 24 | color: $gray-color; 25 | font-size: $font-paragraph; 26 | } 27 | } 28 | 29 | & + .card-footer{ 30 | border-top: 1px solid #eee; 31 | margin-top: 14px; 32 | } 33 | 34 | &.card-header-icon i { 35 | font-size: 36px; 36 | line-height: 56px; 37 | width: 56px; 38 | height: 56px; 39 | text-align: center; 40 | } 41 | } 42 | 43 | .card-body { 44 | text-align: right; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_breakpoints.scss: -------------------------------------------------------------------------------- 1 | // case where behavior is responsive, or with a marker class 2 | @mixin media-breakpoint-down-or($breakpoint, $name) { 3 | #{unquote($name)} { 4 | @content; 5 | } 6 | 7 | @include media-breakpoint-down($breakpoint) { 8 | @content; 9 | } 10 | } 11 | 12 | // case where behavior is responsive, or with a marker class 13 | @mixin media-breakpoint-up-or($breakpoint, $name) { 14 | #{unquote($name)} { 15 | @content; 16 | } 17 | 18 | @include media-breakpoint-up($breakpoint) { 19 | @content; 20 | } 21 | } 22 | 23 | // Name of the previous breakpoint, or null 24 | // 25 | // >> breakpoint-next(sm) 26 | // xs 27 | // >> breakpoint-next(sm, (xs: 0, sm: 544px, md: 768px)) 28 | // xs 29 | // >> breakpoint-next(sm, $breakpoint-names: (xs sm md)) 30 | // xs 31 | @function breakpoint-previous($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { 32 | $n: index($breakpoint-names, $name); 33 | @return if($n > 1, nth($breakpoint-names, $n - 1), null); 34 | } 35 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_hover.scss: -------------------------------------------------------------------------------- 1 | @mixin bmd-hover-focus-active { 2 | // add the .active to the whole mix of hover-focus-active 3 | &.active { 4 | @content; 5 | } 6 | @include hover-focus-active() { 7 | @content; 8 | } 9 | } 10 | 11 | @mixin transform-translate-y($value){ 12 | -webkit-transform: translate3d(0,$value, 0); 13 | -moz-transform: translate3d(0, $value, 0); 14 | -o-transform: translate3d(0, $value, 0); 15 | -ms-transform: translate3d(0, $value, 0); 16 | transform: translate3d(0, $value, 0); 17 | } 18 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_layout.scss: -------------------------------------------------------------------------------- 1 | // Generates the `.in` style for the generic backdrop used components such as the drawer in overlay mode 2 | @mixin bmd-layout-backdrop-in() { 3 | > .bmd-layout-backdrop { 4 | .in { 5 | visibility: visible; 6 | background-color: rgba(0, 0, 0, 0.5); 7 | } 8 | 9 | @supports (pointer-events: auto) { 10 | &.in { 11 | pointer-events: auto; 12 | opacity: 1; 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_navbar-colors.scss: -------------------------------------------------------------------------------- 1 | @mixin navbar-colors($color, $link-color) { 2 | color: $link-color; 3 | background-color: $color !important; 4 | @include shadow-navbar-color($color); 5 | 6 | .dropdown-item:hover, 7 | .dropdown-item:focus{ 8 | @include shadow-small-color($color); 9 | background-color: $color; 10 | color: $link-color; 11 | } 12 | 13 | .navbar-toggler{ 14 | .navbar-toggler-icon{ 15 | background-color: $link-color; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_transparency.scss: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | @mixin opacity($opacity) { 4 | opacity: $opacity; 5 | // IE8 filter 6 | $opacity-ie: ($opacity * 100); 7 | filter: #{alpha(opacity=$opacity-ie)}; 8 | } 9 | 10 | @mixin black-filter($opacity){ 11 | top: 0; 12 | left: 0; 13 | height: 100%; 14 | width: 100%; 15 | position: absolute; 16 | background-color: rgba(17,17,17,$opacity); 17 | display: block; 18 | content: ""; 19 | z-index: 1; 20 | } -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_type.scss: -------------------------------------------------------------------------------- 1 | @mixin headings() { 2 | h1, 3 | h2, 4 | h3, 5 | h4, 6 | h5, 7 | h6 { 8 | @content; 9 | } 10 | } 11 | 12 | // 14sp font 13 | %std-font { 14 | font-size: .875rem; 15 | } 16 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/mixins/_variables.scss: -------------------------------------------------------------------------------- 1 | //== Buttons 2 | // 3 | //## For each of Bootstrap's buttons, define text, background and border color. 4 | 5 | $opacity-gray-3: rgba(222,222,222, .3) !default; 6 | $opacity-gray-5: rgba(222,222,222, .5) !default; 7 | $opacity-gray-8: rgba(222,222,222, .8) !default; 8 | 9 | $opacity-5: rgba(255,255,255, .5) !default; 10 | $opacity-8: rgba(255,255,255, .8) !default; 11 | 12 | $opacity-1: rgba(255,255,255, .1) !default; 13 | $opacity-2: rgba(255,255,255, .2) !default; 14 | 15 | //== Components 16 | // 17 | 18 | $topbar-x: topbar-x !default; 19 | $topbar-back: topbar-back !default; 20 | $bottombar-x: bottombar-x !default; 21 | $bottombar-back: bottombar-back !default; 22 | 23 | // Sidebar variables 24 | $sidebar-width: calc(100% - 260px) !default; 25 | $sidebar-mini-width: calc(100% - 80px) !default; 26 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_body.scss: -------------------------------------------------------------------------------- 1 | // Body 2 | // 3 | // Settings for the `` element. 4 | 5 | $body-bg: #fafafa !default; 6 | //$body-color: $gray-dark !default; 7 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_brand.scss: -------------------------------------------------------------------------------- 1 | // Bootstrap brand color customization 2 | 3 | 4 | /* brand Colors */ 5 | 6 | $brand-primary: $purple-500 !default; 7 | $brand-info: $cyan-500 !default; 8 | $brand-success: $green-500 !default; 9 | $brand-warning: $orange-500 !default; 10 | $brand-danger: $red-500 !default; 11 | $brand-rose: $pink-500 !default; 12 | $brand-inverse: $black-color !default; 13 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_card.scss: -------------------------------------------------------------------------------- 1 | // Cards 2 | //$card-spacer-x: 1.25rem !default; 3 | //$card-spacer-y: .75rem !default; 4 | //$card-border-width: 1px !default; 5 | //$card-border-radius: $border-radius !default; 6 | $card-border-color: $gray-lighter !default; // #e5e5e5 7 | //$card-border-radius-inner: $card-border-radius !default; 8 | $card-bg: #fff !default; 9 | $card-cap-bg: $card-bg !default; // #f5f5f5 10 | // 11 | //$card-link-hover-color: #fff !default; 12 | // 13 | //$card-deck-margin: .625rem !default; 14 | // Card 15 | $mdb-card-body-text: $mdb-text-color-primary !default; 16 | $mdb-card-body-background: #fff !default; 17 | $mdb-card-image-headline: #fff !default; 18 | 19 | $text-disabled: #a8a8a8 !default; 20 | $background-disabled: #eaeaea !default; 21 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_code.scss: -------------------------------------------------------------------------------- 1 | // Code 2 | 3 | $code-bg: $grey-200 !default; // #f7f7f9 !default; 4 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_custom-forms.scss: -------------------------------------------------------------------------------- 1 | $custom-file-bg: transparent !default; 2 | $custom-file-border-width: 0 !default; 3 | $custom-file-box-shadow: none !default; 4 | $custom-file-border-radius: 0 !default; 5 | $custom-file-line-height: 1.3 !default; 6 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_drawer.scss: -------------------------------------------------------------------------------- 1 | // Drawer 2 | 3 | // Sizing 4 | $bmd-drawer-x-size: 240px !default; 5 | $bmd-drawer-y-size: 100px !default; 6 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_dropdown.scss: -------------------------------------------------------------------------------- 1 | // Dropdowns 2 | // 3 | // Dropdown menu container and contents. 4 | 5 | //$dropdown-bg: #fff !default; 6 | //$dropdown-border-color: rgba(0,0,0,.15) !default; 7 | //$dropdown-border-width: $border-width !default; 8 | //$dropdown-divider-bg: #e5e5e5 !default; 9 | $dropdown-box-shadow: $bmd-shadow-2dp !default; //0 6px 12px rgba(0,0,0,.175) !default; 10 | // 11 | //$dropdown-link-color: $gray-dark !default; 12 | //$dropdown-link-hover-color: darken($gray-dark, 5%) !default; 13 | //$dropdown-link-hover-bg: #f5f5f5 !default; 14 | // 15 | //$dropdown-link-active-color: $component-active-color !default; 16 | //$dropdown-link-active-bg: $component-active-bg !default; 17 | // 18 | //$dropdown-link-disabled-color: $gray-light !default; 19 | // 20 | //$dropdown-header-color: $gray-light !default; 21 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_layout.scss: -------------------------------------------------------------------------------- 1 | // Layout variables - evidently nothing to see here...remove now? 2 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List group 2 | 3 | $list-group-bg: inherit !default; // #fff 4 | //$list-group-border-color: #ddd !default; 5 | $list-group-border-width: 0 !default; // $border-width 6 | $list-group-border-radius: 0 !default; // $border-radius 7 | // 8 | //$list-group-hover-bg: #f5f5f5 !default; 9 | //$list-group-active-color: $component-active-color !default; 10 | //$list-group-active-bg: $component-active-bg !default; 11 | //$list-group-active-border: $list-group-active-bg !default; 12 | //$list-group-active-text-color: lighten($list-group-active-bg, 40%) !default; 13 | // 14 | //$list-group-disabled-color: $gray-light !default; 15 | //$list-group-disabled-bg: $gray-lighter !default; 16 | //$list-group-disabled-text-color: $list-group-disabled-color !default; 17 | // 18 | //$list-group-link-color: #555 !default; 19 | //$list-group-link-hover-color: $list-group-link-color !default; 20 | //$list-group-link-heading-color: #333 !default; 21 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_menu.scss: -------------------------------------------------------------------------------- 1 | $bmd-menu-line-height: 1 !default; // makes it easier to use sizes to match spec 2 | 3 | $bmd-menu-item-min-width: 7rem !default; // Minimum width on mobile = 2 * 56dp = 112dp 4 | $bmd-menu-item-max-width: 17.5rem !default; // Maximum width on mobile (in both portrait and landscape) = 5 * 56dp = 280dp 5 | $bmd-menu-item-min-height: 3rem !default; // 48px 6 | 7 | $bmd-menu-item-padding-right: 1rem !default; 8 | $bmd-menu-item-padding-bottom: .8rem !default; 9 | $bmd-menu-item-padding-left: 1rem !default; 10 | $bmd-menu-item-padding-top: .8rem !default; 11 | 12 | // md and up 13 | $bmd-menu-item-padding-right-md: 1.5rem !default; 14 | $bmd-menu-item-padding-left-md: 1.5rem !default; 15 | 16 | // Menu 17 | $bmd-menu-expand-duration: 0.3s !default; 18 | $bmd-menu-fade-duration: 0.2s !default; 19 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_pagination.scss: -------------------------------------------------------------------------------- 1 | $pagination-border-width: 0; 2 | $pagination-bg: transparent; 3 | $pagination-disabled-bg: transparent; 4 | 5 | $pagination-padding-x-lg: 0; 6 | $pagination-padding-x-sm: 0; 7 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_snackbar.scss: -------------------------------------------------------------------------------- 1 | $bmd-snackbar-bg: #323232 !default; 2 | $bmd-snackbar-color: #fff !default; 3 | $bmd-snackbar-min-width: 280px !default; 4 | $bmd-snackbar-padding: .8rem 1.5rem !default; 5 | 6 | $bmd-snackbar-min-width-sm: 100% !default; 7 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_spacing.scss: -------------------------------------------------------------------------------- 1 | // Spacing 2 | // 3 | // Control the default styling of most Bootstrap elements by modifying these 4 | // variables. Mostly focused on spacing. 5 | 6 | $spacer: 1rem !default; // $form-group-margin-bottom uses $spacer-y. Decided to try this globally and see how it works out. 7 | //$spacer-x: $spacer !default; 8 | //$spacer-y: $spacer !default; 9 | //$spacers: ( 10 | // 0: ( 11 | // x: 0, 12 | // y: 0 13 | // ), 14 | // 1: ( 15 | // x: $spacer-x, 16 | // y: $spacer-y 17 | // ), 18 | // 2: ( 19 | // x: ($spacer-x * 1.5), 20 | // y: ($spacer-y * 1.5) 21 | // ), 22 | // 3: ( 23 | // x: ($spacer-x * 3), 24 | // y: ($spacer-y * 3) 25 | // ) 26 | //) !default; 27 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_state.scss: -------------------------------------------------------------------------------- 1 | // Form states and alerts 2 | // 3 | // Define colors for form feedback states and, by default, alerts. 4 | $state-success-text: $bmd-inverse !default; 5 | $state-success-bg: $brand-success !default; 6 | 7 | $state-info-text: $bmd-inverse !default; 8 | $state-info-bg: $brand-info !default; 9 | 10 | $state-warning-text: $bmd-inverse !default; 11 | $state-warning-bg: $brand-warning !default; 12 | 13 | $state-danger-text: $bmd-inverse !default; 14 | $state-danger-bg: $brand-danger !default; 15 | 16 | $state-rose-bg: $brand-rose !default; 17 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_tables.scss: -------------------------------------------------------------------------------- 1 | $table-bg-accent: rgba(#000, .03); 2 | $table-border-color: rgba(#000, .06); 3 | $table-bg-hover: rgba(#000, .02); // Grey 100 (on white background) 4 | 5 | $bmd-table-header-font-size: .95rem; 6 | $bmd-table-border-color-inverse: rgba(#fff, .06); 7 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/assets/scss/core/variables/_tooltip.scss: -------------------------------------------------------------------------------- 1 | $tooltip-bg: rgba($grey-700, .9); 2 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false, 8 | getApiUrl: "https://localhost:44375/WebAPI/api", 9 | getDropDownSetting: { 10 | singleSelection: false, 11 | idField: 'id', 12 | textField: 'label', 13 | selectAllText: 'Select All', 14 | unSelectAllText: 'UnSelect All', 15 | itemsShowLimit: 3, 16 | allowSearchFilter: true 17 | }, 18 | getDatatableSettings: { 19 | pagingType: 'full_numbers', 20 | pageLength: 2 21 | } 22 | 23 | }; 24 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/UiPreparation/UI/src/favicon.ico -------------------------------------------------------------------------------- /UiPreparation/UI/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | DevArchitecture 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 |
27 |
28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/main.ts: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | ========================================================= 4 | * Material Dashboard Angular - v2.4.0 5 | ========================================================= 6 | 7 | * Product Page: https://www.creative-tim.com/product/material-dashboard-angular2 8 | * Copyright 2019 Creative Tim (https://www.creative-tim.com) 9 | * Licensed under MIT (https://github.com/creativetimofficial/material-dashboard-angular2/blob/master/LICENSE.md) 10 | 11 | * Coded by Creative Tim 12 | 13 | ========================================================= 14 | 15 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 16 | 17 | */ 18 | import { enableProdMode } from '@angular/core'; 19 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 20 | 21 | import { AppModule } from './app/app.module'; 22 | import { environment } from './environments/environment'; 23 | import 'hammerjs'; 24 | 25 | if (environment.production) { 26 | enableProdMode(); 27 | } 28 | 29 | platformBrowserDynamic().bootstrapModule(AppModule); 30 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "~bootstrap/dist/css/bootstrap.min.css"; 3 | @import "~font-awesome/css/font-awesome.min.css"; 4 | @import "~alertifyjs/build/css/alertify.min.css"; 5 | @import "~alertifyjs/build/css/themes/bootstrap.min.css"; 6 | @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 7 | 8 | 9 | .no-sort::after { 10 | display: none !important; 11 | background-image: url() !important; 12 | } 13 | 14 | .no-sort { 15 | pointer-events: none !important; 16 | cursor: default !important; 17 | background-image: url() !important; 18 | } 19 | 20 | .card .card-header .card-title { 21 | margin-bottom: -28px !important; 22 | } 23 | 24 | table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc, table.dataTable thead .sorting_asc_disabled, table.dataTable thead .sorting_desc_disabled { 25 | /* cursor: pointer; 26 | *cursor: hand; 27 | background-repeat: no-repeat;*/ 28 | background-position: center left !important; 29 | } 30 | 31 | a:hover { 32 | cursor: pointer !important; 33 | } 34 | 35 | span:hover { 36 | cursor: pointer !important; 37 | } 38 | 39 | table { 40 | width: 100%; 41 | } 42 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare var __karma__: any; 17 | declare var require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "baseUrl": "", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "baseUrl": "", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts", 15 | "polyfills.ts" 16 | ], 17 | "include": [ 18 | "**/*.spec.ts", 19 | "**/*.d.ts" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /UiPreparation/UI/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /UiPreparation/UI/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "baseUrl": "src", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2016", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UiPreparation/UiPreparation.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /WebAPI/Controllers/LogsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Handlers.Logs.Queries; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Threading.Tasks; 4 | 5 | 6 | 7 | namespace WebAPI.Controllers 8 | { 9 | /// 10 | /// If controller methods will not be Authorize, [AllowAnonymous] is used. 11 | /// 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class LogsController : BaseApiController 15 | { 16 | /// 17 | ///List Logs 18 | /// 19 | ///bla bla bla Logs 20 | ///Logs List 21 | /// 22 | [HttpGet("getall")] 23 | public async Task GetList() 24 | { 25 | var result = await Mediator.Send(new GetLogDtoQuery()); 26 | if (result.Success) 27 | { 28 | return Ok(result.Data); 29 | } 30 | return BadRequest(result.Message); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WebAPI/EntityBaseOverride/ServiceInjection.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Design; 2 | using Microsoft.EntityFrameworkCore.Scaffolding.Internal; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace WebAPI.EntityBaseOverride 6 | { 7 | /// 8 | /// 9 | /// 10 | public class ServiceInjection : IDesignTimeServices 11 | { 12 | /// 13 | /// 14 | /// 15 | /// 16 | public void ConfigureDesignTimeServices(IServiceCollection serviceCollection) 17 | { 18 | serviceCollection.AddSingleton(); 19 | } 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /WebAPI/Program.cs: -------------------------------------------------------------------------------- 1 | using Autofac.Extensions.DependencyInjection; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | 6 | 7 | namespace WebAPI 8 | { 9 | /// 10 | /// 11 | /// 12 | public static class Program 13 | { 14 | /// 15 | /// 16 | /// 17 | /// 18 | public static void Main(string[] args) 19 | { 20 | CreateHostBuilder(args).Build().Run(); 21 | 22 | } 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | public static IHostBuilder CreateHostBuilder(string[] args) => 29 | Host.CreateDefaultBuilder(args) 30 | .UseServiceProviderFactory(new AutofacServiceProviderFactory()) 31 | .ConfigureWebHostDefaults(webBuilder => 32 | { 33 | webBuilder.UseStartup(); 34 | }) 35 | .ConfigureLogging(logging => 36 | { 37 | logging.ClearProviders(); 38 | logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); 39 | }); 40 | 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /WebAPI/SwaggerMessages.cs: -------------------------------------------------------------------------------- 1 | namespace WebAPI 2 | { 3 | public partial class Startup 4 | { 5 | static class SwaggerMessages 6 | { 7 | static string Version => "v2"; 8 | static string Title => "DevArchitecture Web API"; 9 | static string ContactName => "DevArchitecture"; 10 | static string LicenceName => "Use under LICX"; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WebAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Services": { 3 | 4 | }, 5 | "ConnectionStrings": { 6 | "DArchInMemory": "Server=(localdb)\\mssqllocaldb;Database=DArch;Trusted_Connection=True;ConnectRetryCount=0" 7 | }, 8 | "Logging": { 9 | "LogLevel": { 10 | "Default": "Debug", 11 | "System": "Information", 12 | "Microsoft": "Information" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /WebAPI/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Services": { 3 | 4 | }, 5 | "ConnectionStrings": { 6 | "DArchPgContext": "Host=localhost;Port=5432;Database=TestDb;Username=postgres;Password=test", 7 | "DArchMsContext": "data source=(local);initial catalog=TestDb;persist security info=False;user id=sa;password=test;" 8 | }, 9 | "Logging": { 10 | "LogLevel": { 11 | "Default": "Information", 12 | "System": "Information", 13 | "Microsoft": "Information" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WebAPI/appsettings.Staging.json: -------------------------------------------------------------------------------- 1 | { 2 | "Services": { 3 | 4 | }, 5 | "ConnectionStrings": { 6 | "DArchPgContext": "Host=localhost;Port=5432;Database=TestDb;Username=postgres;Password=test", 7 | "DArchMsContext": "data source=NEPTUN\\DVLP2008;initial catalog=TestDb;persist security info=False;user id=sa;password=test^3;" 8 | }, 9 | "Logging": { 10 | "LogLevel": { 11 | "Default": "Information", 12 | "Microsoft": "Warning", 13 | "Microsoft.Hosting.Lifetime": "Information" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WebAPI/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rzayevsahil/DevArchitecture/df5f8b63dacef7696e77238db550d0eda71d4959/WebAPI/appsettings.json -------------------------------------------------------------------------------- /WebAPI/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------